Skip to content

Commit

Permalink
fix(arborist-url): get env var in app_init instead of config
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Oct 4, 2019
1 parent 601312f commit 3f66984
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions sheepdog/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ def app_init(app):
except KeyError:
app.logger.error("Secret key not set in config! Authentication will not work")

if app.config.get("ARBORIST_URL"):
app.auth = ArboristClient(arborist_base_url=app.config["ARBORIST_URL"])
arborist_url = os.environ.get("ARBORIST_URL", "http://arborist-service/")
if arborist_url:
app.auth = ArboristClient(arborist_base_url=arborist_url)
else:
app.logger.info("Using default Arborist base URL")
app.auth = ArboristClient()
Expand Down
2 changes: 0 additions & 2 deletions sheepdog/dev_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
"user_domain_name": env.get("KEYSTONE_DOMAIN"),
}

ARBORIST_URL = env.get("ARBORIST_URL", "http://arborist-service/")

# Storage
CLEVERSAFE_HOST = env.get("CLEVERSAFE_HOST", "cleversafe.service.consul")

Expand Down
2 changes: 0 additions & 2 deletions sheepdog/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
"user_domain_name": "some_domain",
}

ARBORIST_URL = os.environ.get("ARBORIST_URL", "http://arborist-service/")

SUBMISSION = {"bucket": "test_submission", "host": "host"}


Expand Down

0 comments on commit 3f66984

Please sign in to comment.