From 2eb3e5323d226a928ac1ab96c9c9e1637413f92a Mon Sep 17 00:00:00 2001 From: Pauline Date: Fri, 4 Oct 2019 11:33:35 -0500 Subject: [PATCH 1/4] fix(arborist-url) --- peregrine/api.py | 4 ++-- peregrine/dev_settings.py | 2 +- peregrine/test_settings.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/peregrine/api.py b/peregrine/api.py index 23359b59..29ac05ed 100644 --- a/peregrine/api.py +++ b/peregrine/api.py @@ -133,8 +133,8 @@ def app_init(app): ) async_pool_init(app) - if app.config.get("ARBORIST"): - app.auth = ArboristClient(arborist_base_url=app.config["ARBORIST"]) + if app.config.get("ARBORIST_URL"): + app.auth = ArboristClient(arborist_base_url=app.config["ARBORIST_URL"]) else: app.logger.info("Using default Arborist base URL") app.auth = ArboristClient() diff --git a/peregrine/dev_settings.py b/peregrine/dev_settings.py index 4188fa02..70a94fe4 100644 --- a/peregrine/dev_settings.py +++ b/peregrine/dev_settings.py @@ -19,7 +19,7 @@ 'auth_url': env.get('KEYSTONE_AUTH_URL'), 'user_domain_name': env.get('KEYSTONE_DOMAIN')} -ARBORIST = "http://arborist-service/" +ARBORIST_URL = env.get("ARBORIST_URL", "http://arborist-service/") # Storage CLEVERSAFE_HOST = env.get('CLEVERSAFE_HOST', 'cleversafe.service.consul') diff --git a/peregrine/test_settings.py b/peregrine/test_settings.py index bca35781..29c5b5e5 100644 --- a/peregrine/test_settings.py +++ b/peregrine/test_settings.py @@ -15,7 +15,7 @@ 'user_domain_name': 'some_domain', } -ARBORIST = "http://arborist-service/" +ARBORIST_URL = os.environ.get("ARBORIST_URL", "http://arborist-service/") SUBMISSION = { "bucket": 'test_submission', From 6ab1f22175a248f082cb555613000914887f5b27 Mon Sep 17 00:00:00 2001 From: Pauline Date: Fri, 4 Oct 2019 12:39:16 -0500 Subject: [PATCH 2/4] fix(arborist-url): get env var in app_init instead of config --- peregrine/api.py | 5 +++-- peregrine/dev_settings.py | 2 -- peregrine/test_settings.py | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/peregrine/api.py b/peregrine/api.py index 29ac05ed..05ebb562 100644 --- a/peregrine/api.py +++ b/peregrine/api.py @@ -133,8 +133,9 @@ def app_init(app): ) async_pool_init(app) - 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() diff --git a/peregrine/dev_settings.py b/peregrine/dev_settings.py index 70a94fe4..ed77c1d4 100644 --- a/peregrine/dev_settings.py +++ b/peregrine/dev_settings.py @@ -19,8 +19,6 @@ 'auth_url': env.get('KEYSTONE_AUTH_URL'), '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') diff --git a/peregrine/test_settings.py b/peregrine/test_settings.py index 29c5b5e5..ff0e1198 100644 --- a/peregrine/test_settings.py +++ b/peregrine/test_settings.py @@ -15,8 +15,6 @@ 'user_domain_name': 'some_domain', } -ARBORIST_URL = os.environ.get("ARBORIST_URL", "http://arborist-service/") - SUBMISSION = { "bucket": 'test_submission', "host": 'host', From 2e3a2a71c30de6e863ad3ba419ef47946335bdcf Mon Sep 17 00:00:00 2001 From: Pauline Date: Fri, 4 Oct 2019 13:46:45 -0500 Subject: [PATCH 3/4] fix(arborist-url): backwards compatible --- peregrine/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/peregrine/api.py b/peregrine/api.py index 05ebb562..481ad45d 100644 --- a/peregrine/api.py +++ b/peregrine/api.py @@ -133,7 +133,8 @@ def app_init(app): ) async_pool_init(app) - arborist_url = os.environ.get("ARBORIST_URL", "http://arborist-service/") + # ARBORIST deprecated, replaced by ARBORIST_URL + arborist_url = os.environ.get("ARBORIST_URL", os.environ.get("ARBORIST")) if arborist_url: app.auth = ArboristClient(arborist_base_url=arborist_url) else: From 873f038adecb304e4f4c5ba90b87ae62ece25e95 Mon Sep 17 00:00:00 2001 From: Pauline Date: Fri, 4 Oct 2019 14:29:07 -0500 Subject: [PATCH 4/4] trigger quay...