launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #25034
[Merge] ~pappacena/turnip:cast-timeout-config into turnip:master
Thiago F. Pappacena has proposed merging ~pappacena/turnip:cast-timeout-config into turnip:master.
Commit message:
Casting timeout config to proper type
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~pappacena/turnip/+git/turnip/+merge/387592
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/turnip:cast-timeout-config into turnip:master.
diff --git a/turnip/pack/git.py b/turnip/pack/git.py
index 709de4e..794a1c3 100644
--- a/turnip/pack/git.py
+++ b/turnip/pack/git.py
@@ -517,7 +517,7 @@ class PackBackendProtocol(PackServerProtocol):
:param auth_params: Authorization info.
"""
xmlrpc_endpoint = config.get("virtinfo_endpoint")
- xmlrpc_timeout = config.get("virtinfo_timeout")
+ xmlrpc_timeout = int(config.get("virtinfo_timeout"))
proxy = xmlrpc.Proxy(xmlrpc_endpoint, allowNone=True)
try:
repo_path = compose_path(self.factory.root, pathname)
diff --git a/turnip/pack/tests/test_git.py b/turnip/pack/tests/test_git.py
index 8a53d54..dd53025 100644
--- a/turnip/pack/tests/test_git.py
+++ b/turnip/pack/tests/test_git.py
@@ -198,6 +198,10 @@ class TestPackBackendProtocol(TestCase):
def setupConfig(self):
config.defaults['virtinfo_endpoint'] = self.virtinfo_url
+ # Force timeout to be a string to make sure we are casting it
+ # to a proper type (setting it using env vars could make this use
+ # the wrong typing).
+ config.defaults['virtinfo_endpoint'] = '15'
def assertKilledWith(self, message):
self.assertFalse(self.transport.connected)