← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pelpsi/launchpad:refactor-requestProxyToken-function into launchpad:master

 

Simone Pelosi has proposed merging ~pelpsi/launchpad:refactor-requestProxyToken-function into launchpad:master.

Commit message:
Refactor requestProxyToken function to be aligned with requestFetchServiceSession

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pelpsi/launchpad/+git/launchpad/+merge/462143
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pelpsi/launchpad:refactor-requestProxyToken-function into launchpad:master.
diff --git a/lib/lp/buildmaster/builderproxy.py b/lib/lp/buildmaster/builderproxy.py
index 1ac121f..a1d475b 100644
--- a/lib/lp/buildmaster/builderproxy.py
+++ b/lib/lp/buildmaster/builderproxy.py
@@ -84,23 +84,11 @@ class BuilderProxyMixin:
 
     @defer.inlineCallbacks
     def _requestProxyToken(self):
-        admin_username = _get_proxy_config(
+        admin_username = _get_value_from_config(
             "builder_proxy_auth_api_admin_username"
         )
-        if not admin_username:
-            raise CannotBuild(
-                "builder_proxy_auth_api_admin_username is not configured."
-            )
-        secret = _get_proxy_config("builder_proxy_auth_api_admin_secret")
-        if not secret:
-            raise CannotBuild(
-                "builder_proxy_auth_api_admin_secret is not configured."
-            )
-        url = _get_proxy_config("builder_proxy_auth_api_endpoint")
-        if not secret:
-            raise CannotBuild(
-                "builder_proxy_auth_api_endpoint is not configured."
-            )
+        secret = _get_value_from_config("builder_proxy_auth_api_admin_secret")
+        url = _get_value_from_config("builder_proxy_auth_api_endpoint")
         timestamp = int(time.time())
         proxy_username = "{build_id}-{timestamp}".format(
             build_id=self.build.build_cookie, timestamp=timestamp

Follow ups