← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/turnip:xmlrpc-str-method-names into turnip:master

 

Thiago F. Pappacena has proposed merging ~pappacena/turnip:xmlrpc-str-method-names into turnip:master.

Commit message:
Fixing Python3 compatibility with XMLRPC's proxy.callRemote (method names should be str, not bytes).

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/turnip/+git/turnip/+merge/380127
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/turnip:xmlrpc-str-method-names into turnip:master.
diff --git a/turnip/pack/git.py b/turnip/pack/git.py
index 762be91..e09e2b5 100644
--- a/turnip/pack/git.py
+++ b/turnip/pack/git.py
@@ -560,7 +560,7 @@ class PackVirtServerProtocol(PackProxyServerProtocol):
             auth_params = self.createAuthParams(params)
             self.log.info("Translating request.")
             translated = yield proxy.callRemote(
-                b'translatePath', pathname, permission,
+                'translatePath', pathname, permission,
                 auth_params).addTimeout(
                     self.factory.virtinfo_timeout, self.factory.reactor)
             self.log.info(
diff --git a/turnip/pack/hookrpc.py b/turnip/pack/hookrpc.py
index 91a03a4..c5b0d68 100644
--- a/turnip/pack/hookrpc.py
+++ b/turnip/pack/hookrpc.py
@@ -168,7 +168,7 @@ class HookRPCHandler(object):
             proxy = xmlrpc.Proxy(self.virtinfo_url, allowNone=True)
             try:
                 result = yield proxy.callRemote(
-                    b'checkRefPermissions',
+                    'checkRefPermissions',
                     ref_path,
                     [xmlrpc_client.Binary(path) for path in missing],
                     auth_params).addTimeout(
@@ -228,7 +228,7 @@ class HookRPCHandler(object):
     @defer.inlineCallbacks
     def notify(self, path):
         proxy = xmlrpc.Proxy(self.virtinfo_url, allowNone=True)
-        yield proxy.callRemote(b'notify', path).addTimeout(
+        yield proxy.callRemote('notify', path).addTimeout(
             self.virtinfo_timeout, self.reactor)
 
     @defer.inlineCallbacks
diff --git a/turnip/pack/http.py b/turnip/pack/http.py
index 573a37d..c0becf0 100644
--- a/turnip/pack/http.py
+++ b/turnip/pack/http.py
@@ -660,7 +660,7 @@ class HTTPAuthRootResource(BaseHTTPAuthResource):
         identity_url = session.get('identity_url', self.anonymous_id)
         proxy = xmlrpc.Proxy(self.root.virtinfo_endpoint, allowNone=True)
         d = proxy.callRemote(
-            b'translatePath', request.path, b'read',
+            'translatePath', request.path, b'read',
             {'uid': identity_url, 'can-authenticate': True})
         d.addTimeout(self.root.virtinfo_timeout, self.root.reactor)
         d.addCallback(self._translatePathCallback, request)
@@ -782,7 +782,7 @@ class SmartHTTPFrontendResource(resource.Resource):
         proxy = xmlrpc.Proxy(self.virtinfo_endpoint)
         try:
             translated = yield proxy.callRemote(
-                b'authenticateWithPassword', user, password)
+                'authenticateWithPassword', user, password)
         except xmlrpc.Fault as e:
             code = translate_xmlrpc_fault(e.faultCode)
             if code == TurnipFaultCode.UNAUTHORIZED: