Re: [Freeipa-devel] [PATCH 0118] fix Py3 incompatible exception instantiation in replica install code

2016-01-13 Thread Martin Basti



On 11.01.2016 13:30, Martin Babinsky wrote:

On 01/08/2016 06:26 PM, Tomas Babej wrote:



On 01/07/2016 05:56 PM, Martin Babinsky wrote:

On 01/04/2016 09:02 AM, Martin Babinsky wrote:





I have created ticket to patch and added it to commit message:

https://fedorahosted.org/freeipa/ticket/5585





ACK for these changes, however, there are additional occurrences in the
code base, attaching a patch.

Tomas




ACK


Pushed to:
master: 50627004b83fe155767fb02b51099eba612a5855
ipa-4-3: 1181926c970e71cec728bed9ac4b16a2664ef97d

--
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


Re: [Freeipa-devel] [PATCH 0118] fix Py3 incompatible exception instantiation in replica install code

2016-01-11 Thread Martin Babinsky

On 01/08/2016 06:26 PM, Tomas Babej wrote:



On 01/07/2016 05:56 PM, Martin Babinsky wrote:

On 01/04/2016 09:02 AM, Martin Babinsky wrote:





I have created ticket to patch and added it to commit message:

https://fedorahosted.org/freeipa/ticket/5585





ACK for these changes, however, there are additional occurrences in the
code base, attaching a patch.

Tomas




ACK

--
Martin^3 Babinsky

--
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


Re: [Freeipa-devel] [PATCH 0118] fix Py3 incompatible exception instantiation in replica install code

2016-01-08 Thread Tomas Babej


On 01/07/2016 05:56 PM, Martin Babinsky wrote:
> On 01/04/2016 09:02 AM, Martin Babinsky wrote:
>>
>>
>>
> I have created ticket to patch and added it to commit message:
> 
> https://fedorahosted.org/freeipa/ticket/5585
> 
> 
> 

ACK for these changes, however, there are additional occurrences in the
code base, attaching a patch.

Tomas
From 7475c1650e5cc5478a65166d853822b93419cd5e Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Fri, 8 Jan 2016 18:23:35 +0100
Subject: [PATCH] py3: Remove py3 incompatible exception handling

---
 doc/guide/guide.org| 4 ++--
 doc/guide/wsgi.py.txt  | 2 +-
 ipaserver/install/server/common.py | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/guide/guide.org b/doc/guide/guide.org
index 55c172535007b71e95f804f1a171fa547cfdf032..6d181559f0af90e7be7089aa94ab4900fa4e90b5 100644
--- a/doc/guide/guide.org
+++ b/doc/guide/guide.org
@@ -752,9 +752,9 @@ def run(api):
 except KeyboardInterrupt:
 print ''
 api.log.info('operation aborted')
-except PublicError, e:
+except PublicError as e:
 error = e
-except Exception, e:
+except Exception as e:
 api.log.exception('%s: %s', e.__class__.__name__, str(e))
 error = InternalError()
 if error is not None:
diff --git a/doc/guide/wsgi.py.txt b/doc/guide/wsgi.py.txt
index eb64f3a8285495ac0131872c99ab05485587556b..8566a25a16baa8c43288eee8bc480ffbd6eadf0b 100644
--- a/doc/guide/wsgi.py.txt
+++ b/doc/guide/wsgi.py.txt
@@ -13,7 +13,7 @@ env._finalize_core(**dict(DEFAULT_CONFIG))
 api.bootstrap(context='server', debug=env.debug, log=None) (ref:wsgi-app-bootstrap)
 try:
 api.finalize() (ref:wsgi-app-finalize)
-except Exception, e:
+except Exception as e:
 api.log.error('Failed to start IPA: %s' % e)
 else:
 api.log.info('*** PROCESS START ***')
diff --git a/ipaserver/install/server/common.py b/ipaserver/install/server/common.py
index 637e5664348bf3b7f2e4f2a867b8ecb224ccf388..08980c60f59ce0599a9bbe1cf53dcb2eedf7808d 100644
--- a/ipaserver/install/server/common.py
+++ b/ipaserver/install/server/common.py
@@ -138,7 +138,7 @@ class BaseServerCA(common.Installable, core.Group, core.Composite):
 for rdn in dn:
 if rdn.attr.lower() not in VALID_SUBJECT_ATTRS:
 raise ValueError("invalid attribute: \"%s\"" % rdn.attr)
-except ValueError, e:
+except ValueError as e:
 raise ValueError("invalid subject base format: %s" % e)
 
 ca_signing_algorithm = Knob(
@@ -243,7 +243,7 @@ class BaseServerDNS(common.Installable, core.Group, core.Composite):
 encoding = 'utf-8'
 value = value.decode(encoding)
 bindinstance.validate_zonemgr_str(value)
-except ValueError, e:
+except ValueError as e:
 # FIXME we can do this in better way
 # https://fedorahosted.org/freeipa/ticket/4804
 # decode to proper stderr encoding
-- 
2.5.0

-- 
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

Re: [Freeipa-devel] [PATCH 0118] fix Py3 incompatible exception instantiation in replica install code

2016-01-07 Thread Martin Babinsky

On 01/04/2016 09:02 AM, Martin Babinsky wrote:





I have created ticket to patch and added it to commit message:

https://fedorahosted.org/freeipa/ticket/5585

--
Martin^3 Babinsky
From 8d2779da21b2110ad879e413a2434c4b7e702d35 Mon Sep 17 00:00:00 2001
From: Martin Babinsky 
Date: Wed, 16 Dec 2015 10:56:06 +0100
Subject: [PATCH] fix Py3 incompatible exception instantiation in replica
 install code

https://fedorahosted.org/freeipa/ticket/5585
---
 ipaserver/install/server/replicainstall.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 78e32ae9b6ee5aacef9a1db055f576a996fd03f0..2adf4a0b773ab466e3df3d75ce2e8afe345f9240 100644
--- a/ipaserver/install/server/replicainstall.py
+++ b/ipaserver/install/server/replicainstall.py
@@ -335,7 +335,7 @@ def configure_certmonger():
 messagebus = services.knownservices.messagebus
 try:
 messagebus.start()
-except Exception, e:
+except Exception as e:
 print("Messagebus service unavailable: %s" % str(e))
 sys.exit(3)
 
@@ -344,13 +344,13 @@ def configure_certmonger():
 cmonger = services.knownservices.certmonger
 try:
 cmonger.restart()
-except Exception, e:
+except Exception as e:
 print("Certmonger service unavailable: %s" % str(e))
 sys.exit(3)
 
 try:
 cmonger.enable()
-except Exception, e:
+except Exception as e:
 print("Failed to enable Certmonger: %s" % str(e))
 sys.exit(3)
 
@@ -893,7 +893,7 @@ def promote_check(installer):
 if not options.no_ntp:
 try:
 ipaclient.ntpconf.check_timedate_services()
-except ipaclient.ntpconf.NTPConflictingService, e:
+except ipaclient.ntpconf.NTPConflictingService as e:
 print("WARNING: conflicting time&date synchronization service '%s'"
   " will" % e.conflicting_service)
 print("be disabled in favor of ntpd")
-- 
2.5.0

-- 
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