On 2015-07-13 16:29, Alexander Bokovoy wrote:
>> I will push&mark the commit there.
> Please do not push this specific version of the patch yet. Christian
> will do the changes with four separate commits as discussed on the IRC,
> to avoid future problems with maintenance and backports.
Alex,
please have a look at the patches. I have split the patch into four
files, one for every file. Is that right?
Christian
From 995001a2960da3482300791baa4a8cbf5b325fc7 Mon Sep 17 00:00:00 2001
From: Christian Heimes
Date: Tue, 14 Jul 2015 10:49:39 +0200
Subject: [PATCH 07/10] Remove tuple unpacking from except clause
contrib/RHEL4/ipachangeconf.py
Python 3 doesn't support tuple unpacking in except clauses. All implicit
tuple unpackings have been replaced with explicit unpacking of e.args.
https://fedorahosted.org/freeipa/ticket/5120
---
contrib/RHEL4/ipachangeconf.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/RHEL4/ipachangeconf.py b/contrib/RHEL4/ipachangeconf.py
index 1a361513558f20d65ac8cbb0044e7b8d352e6bad..87b306f5dff336f80b1d02909433253f148108a6 100644
--- a/contrib/RHEL4/ipachangeconf.py
+++ b/contrib/RHEL4/ipachangeconf.py
@@ -29,13 +29,13 @@ def openLocked(filename, perms):
fd = os.open(filename, os.O_RDWR | os.O_CREAT, perms)
fcntl.lockf(fd, fcntl.LOCK_EX)
-except OSError, (errno, strerr):
+except OSError as e:
if fd != -1:
try:
os.close(fd)
except OSError:
pass
-raise IOError(errno, strerr)
+raise IOError(e.errno, e.strerror)
return os.fdopen(fd, "r+")
--
2.4.3
From 8898e4762b908a10fee3bc4d33071b827c7e8175 Mon Sep 17 00:00:00 2001
From: Christian Heimes
Date: Tue, 14 Jul 2015 10:50:04 +0200
Subject: [PATCH 08/10] Remove tuple unpacking from except clause
ipa-client/ipaclient/ipachangeconf.py
Python 3 doesn't support tuple unpacking in except clauses. All implicit
tuple unpackings have been replaced with explicit unpacking of e.args.
https://fedorahosted.org/freeipa/ticket/5120
---
ipa-client/ipaclient/ipachangeconf.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipa-client/ipaclient/ipachangeconf.py b/ipa-client/ipaclient/ipachangeconf.py
index 15d41274f7a99550b0a49314fb949402e65ee1d1..edf34f5ae738eb22b8935c222392dc9b6f08638d 100644
--- a/ipa-client/ipaclient/ipachangeconf.py
+++ b/ipa-client/ipaclient/ipachangeconf.py
@@ -31,13 +31,13 @@ def openLocked(filename, perms):
fd = os.open(filename, os.O_RDWR | os.O_CREAT, perms)
fcntl.lockf(fd, fcntl.LOCK_EX)
-except OSError, (errno, strerr):
+except OSError as e:
if fd != -1:
try:
os.close(fd)
except OSError:
pass
-raise IOError(errno, strerr)
+raise IOError(e.errno, e.strerror)
return os.fdopen(fd, "r+")
--
2.4.3
From 1d5f4d9bb77b1dc983244f45e560a98c90697f19 Mon Sep 17 00:00:00 2001
From: Christian Heimes
Date: Tue, 14 Jul 2015 10:50:18 +0200
Subject: [PATCH 09/10] Remove tuple unpacking from except clause
ipalib/plugins/hbactest.py
Python 3 doesn't support tuple unpacking in except clauses. All implicit
tuple unpackings have been replaced with explicit unpacking of e.args.
https://fedorahosted.org/freeipa/ticket/5120
---
ipalib/plugins/hbactest.py | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ipalib/plugins/hbactest.py b/ipalib/plugins/hbactest.py
index 068190310bf14d068620bc4a86d1c48ae1437251..c8dedd367e78cbe900b716369f8ef78575a21298 100644
--- a/ipalib/plugins/hbactest.py
+++ b/ipalib/plugins/hbactest.py
@@ -462,13 +462,14 @@ class hbactest(Command):
matched_rules.append(ipa_rule.name)
if res == pyhbac.HBAC_EVAL_DENY:
notmatched_rules.append(ipa_rule.name)
-except pyhbac.HbacError as (code, rule_name):
+except pyhbac.HbacError as e:
+code, rule_name = e.args
if code == pyhbac.HBAC_EVAL_ERROR:
error_rules.append(rule_name)
self.log.info('Native IPA HBAC rule "%s" parsing error: %s' % \
(rule_name, pyhbac.hbac_result_string(code)))
-except (TypeError, IOError) as (info):
-self.log.error('Native IPA HBAC module error: %s' % (info))
+except (TypeError, IOError) as info:
+self.log.error('Native IPA HBAC module error: %s' % info)
access_granted = len(matched_rules) > 0
else:
--
2.4.3
From 6b5b5f4d868c0a181f9465a45efc31030a89b027 Mon Sep 17 00:00:00 2001
From: Christian Heimes
Date: Tue, 14 Jul 2015 10:50:34 +0200
Subject: [PATCH 10/10] Remove tuple unpacking from except clause
ipaserver/dcerpc.py
Python 3 doesn't support tuple unpacking in except clauses. All implicit
tuple unp