diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-07-30 16:49:29 +0200 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2015-08-12 18:17:23 +0200 |
commit | 27dabb45282911e375336f75934af9dd6cc5d963 (patch) | |
tree | 3c8fe5255d60613fa9cd14d053b3688feed740c9 /ipaserver/install/bindinstance.py | |
parent | a651be3eec2a08bd2865b16b0eed767db69aab0f (diff) | |
download | freeipa-27dabb45282911e375336f75934af9dd6cc5d963.tar.gz freeipa-27dabb45282911e375336f75934af9dd6cc5d963.tar.xz freeipa-27dabb45282911e375336f75934af9dd6cc5d963.zip |
Modernize 'except' clauses
The 'as' syntax works from Python 2 on, and Python 3 will
drop the "comma" syntax.
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipaserver/install/bindinstance.py')
-rw-r--r-- | ipaserver/install/bindinstance.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py index 6d3470373..4a09d3685 100644 --- a/ipaserver/install/bindinstance.py +++ b/ipaserver/install/bindinstance.py @@ -392,7 +392,7 @@ def zonemgr_callback(option, opt_str, value, parser): encoding = 'utf-8' value = value.decode(encoding) 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 @@ -935,7 +935,7 @@ class BindInstance(service.Service): self.admin_conn.modify_s(dns_group, mod) except ldap.TYPE_OR_VALUE_EXISTS: pass - except Exception, e: + except Exception as e: root_logger.critical("Could not modify principal's %s entry: %s" \ % (dns_principal, str(e))) raise @@ -948,7 +948,7 @@ class BindInstance(service.Service): (ldap.MOD_REPLACE, 'nsLookThroughLimit', '-1')] try: self.admin_conn.modify_s(dns_principal, mod) - except Exception, e: + except Exception as e: root_logger.critical("Could not set principal's %s LDAP limits: %s" \ % (dns_principal, str(e))) raise @@ -1180,7 +1180,7 @@ class BindInstance(service.Service): for f in [NAMED_CONF, RESOLV_CONF]: try: self.fstore.restore_file(f) - except ValueError, error: + except ValueError as error: root_logger.debug(error) pass |