← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ines-almeida/launchpad-buildd:fetch-service-add-proxy-info-endpoint into launchpad-buildd:master

 

Ines Almeida has proposed merging ~ines-almeida/launchpad-buildd:fetch-service-add-proxy-info-endpoint into launchpad-buildd:master.

Commit message:
WIP

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ines-almeida/launchpad-buildd/+git/launchpad-buildd/+merge/465154
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/launchpad-buildd:fetch-service-add-proxy-info-endpoint into launchpad-buildd:master.
diff --git a/bin/test_buildd_generatetranslationtemplates b/bin/test_buildd_generatetranslationtemplates
index ffaf819..be4e1ef 100755
--- a/bin/test_buildd_generatetranslationtemplates
+++ b/bin/test_buildd_generatetranslationtemplates
@@ -19,6 +19,7 @@ chroot_sha1 = sys.argv[1]
 
 proxy = ServerProxy("http://localhost:8221/rpc";)
 print(proxy.info())
+print(proxy.proxy_info())
 print(proxy.status())
 buildid = "1-2"
 build_type = "translation-templates"
diff --git a/bin/test_buildd_recipe b/bin/test_buildd_recipe
index a1b4a26..4622396 100755
--- a/bin/test_buildd_recipe
+++ b/bin/test_buildd_recipe
@@ -25,6 +25,7 @@ def deb_line(host, suites):
 proxy = ServerProxy("http://localhost:8221/rpc";)
 print(proxy.echo("Hello World"))
 print(proxy.info())
+print(proxy.proxy_info())
 status = proxy.status()
 print(status)
 if status[0] != "BuilderStatus.IDLE":
diff --git a/lpbuildd/builder.py b/lpbuildd/builder.py
index ed624b3..f821b34 100644
--- a/lpbuildd/builder.py
+++ b/lpbuildd/builder.py
@@ -786,6 +786,11 @@ class XMLRPCBuilder(xmlrpc.XMLRPC):
         """Echo the argument back."""
         return args
 
+    def xmlrpc_proxy_info(self):
+        """Return the details for the proxy used by the manager."""
+        proxy_fields = ["use_fetch_service", "revocation_endpoint"]
+        return {k: getattr(self.builder.manager, k) for k in proxy_fields}
+
     def xmlrpc_info(self):
         """Return the protocol version and the manager methods supported."""
         return (
diff --git a/lpbuildd/tests/test_buildd.py b/lpbuildd/tests/test_buildd.py
index 569a901..616fd9d 100644
--- a/lpbuildd/tests/test_buildd.py
+++ b/lpbuildd/tests/test_buildd.py
@@ -253,3 +253,9 @@ class XMLRPCBuilderTests(unittest.TestCase):
             info.startswith("%s not in [" % buildername),
             'UNKNOWNBUILDER info is "%s"' % info,
         )
+
+    def test_proxy_info(self):
+        """Check that `proxy_info` returns expected details from the proxy."""
+        proxy_info = self.server.proxy_info()
+        self.assertIn("revocation_endpoint", proxy_info)
+        self.assertIn("use_fetch_service", proxy_info)

Follow ups