Hi,
With these patches, xmlrpc_tests pass for me (except those that fail on
py2, and, if python3-ipaserver is installed, some in permission that use
ldap2 plugin).



-- 
Petr Viktorin
From 55da506e7fe3a4aa22a4fc5228e168f7af958c74 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Tue, 3 May 2016 15:53:12 +0200
Subject: [PATCH] Fix remaining relative import and enable Pylint check

Relative imports are not supported in Python 3.

Part of the work for: https://fedorahosted.org/freeipa/ticket/4985
---
 ipaserver/install/custodiainstance.py | 2 +-
 pylintrc                              | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/ipaserver/install/custodiainstance.py b/ipaserver/install/custodiainstance.py
index 424e0797b682d312c07ebf86a13c27164cae6faf..d5c5bf738752ab4cf84f98285a37b820c80fa3be 100644
--- a/ipaserver/install/custodiainstance.py
+++ b/ipaserver/install/custodiainstance.py
@@ -4,7 +4,7 @@ from ipapython.secrets.kem import IPAKEMKeys
 from ipapython.secrets.client import CustodiaClient
 from ipaplatform.paths import paths
 from ipaplatform.constants import constants
-from service import SimpleServiceInstance
+from ipaserver.install.service import SimpleServiceInstance
 from ipapython import ipautil
 from ipapython.ipa_log_manager import root_logger
 from ipaserver.install import installutils
diff --git a/pylintrc b/pylintrc
index 424d76249026a4c549c6d0e08fc9401f3c442491..7ef441844ef0051ddbdec348236e6fdc308f79b6 100644
--- a/pylintrc
+++ b/pylintrc
@@ -39,7 +39,6 @@ disable=
     redefine-in-handler,
     redefined-builtin,
     redefined-outer-name,
-    relative-import,
     super-init-not-called,
     undefined-loop-variable,
     unnecessary-lambda,
-- 
2.5.5

From df536d7eec3df930e7087309f04b4d78ce69ee65 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Thu, 5 May 2016 16:49:24 +0200
Subject: [PATCH] ipalib.cli: Improve reporting of binary values in the CLI

Make sure the base64-encoded value is a string, so it is printed
without the b'' markers.

Part of the work for: https://fedorahosted.org/freeipa/ticket/4985
---
 ipalib/cli.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipalib/cli.py b/ipalib/cli.py
index 3592d3b61051e904ab4c871bd2c83cd7c57845f2..3692e4e531311369cc683a88b96701a45315a6fa 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -164,10 +164,11 @@ class textui(backend.Backend):
     def encode_binary(self, value):
         """
         Convert a binary value to base64. We know a value is binary
-        if it is a python str type, otherwise it is a plain string.
+        if it is a python bytes type, otherwise it is a plain string.
+        This function also converts datetime and DNSName values to string.
         """
         if type(value) is bytes:
-            return base64.b64encode(value)
+            return base64.b64encode(value).decode('ascii')
         elif type(value) is datetime.datetime:
             return value.strftime(LDAP_GENERALIZED_TIME_FORMAT)
         elif isinstance(value, DNSName):
-- 
2.5.5

From 30989e65e965f82fcdf1bd3a51e2118a164e1879 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Thu, 5 May 2016 16:56:24 +0200
Subject: [PATCH] test_cert_plugin: Encode 'certificate' for comparison with
 'usercertificate'

The 'certificate' option is Str, but 'usercertificate' is Bytes.
Decode before comparing one with the other.

Part of the work for: https://fedorahosted.org/freeipa/ticket/4985
---
 ipatests/test_xmlrpc/test_cert_plugin.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_xmlrpc/test_cert_plugin.py b/ipatests/test_xmlrpc/test_cert_plugin.py
index 1276e9cf9de3ea3a57f49043fdb3a8f74adc138e..7f320c157ae3e11b94d8c18275f6d02b2e49874e 100644
--- a/ipatests/test_xmlrpc/test_cert_plugin.py
+++ b/ipatests/test_xmlrpc/test_cert_plugin.py
@@ -149,7 +149,7 @@ class test_cert(XMLRPC_test):
         res = api.Command['cert_request'](csr, principal=self.service_princ, add=True)['result']
         assert DN(res['subject']) == self.subject
         # save the cert for the service_show/find tests
-        cert = res['certificate']
+        cert = res['certificate'].encode('ascii')
 
     def test_0003_service_show(self):
         """
@@ -180,7 +180,7 @@ class test_cert(XMLRPC_test):
         res = api.Command['cert_request'](csr, principal=self.service_princ)['result']
         assert DN(res['subject']) == self.subject
         # save the cert for the service_show/find tests
-        newcert = res['certificate']
+        newcert = res['certificate'].encode('ascii')
 
     def test_0006_service_show(self):
         """
-- 
2.5.5

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to