summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-compat-manage
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-07-30 16:49:29 +0200
committerTomas Babej <tbabej@redhat.com>2015-08-12 18:17:23 +0200
commit27dabb45282911e375336f75934af9dd6cc5d963 (patch)
tree3c8fe5255d60613fa9cd14d053b3688feed740c9 /install/tools/ipa-compat-manage
parenta651be3eec2a08bd2865b16b0eed767db69aab0f (diff)
downloadfreeipa-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 'install/tools/ipa-compat-manage')
-rwxr-xr-xinstall/tools/ipa-compat-manage14
1 files changed, 7 insertions, 7 deletions
diff --git a/install/tools/ipa-compat-manage b/install/tools/ipa-compat-manage
index 7d9d20ccc..ee8ac6015 100755
--- a/install/tools/ipa-compat-manage
+++ b/install/tools/ipa-compat-manage
@@ -111,9 +111,9 @@ def main():
conn.connect(
bind_dn=DN(('cn', 'directory manager')), bind_pw=dirman_password
)
- except errors.ExecutionError, lde:
+ except errors.ExecutionError as lde:
sys.exit("An error occurred while connecting to the server.\n%s\n" % str(lde))
- except errors.ACIError, e:
+ except errors.ACIError as e:
sys.exit("Authentication failed: %s" % e.info)
if args[0] == "status":
@@ -124,7 +124,7 @@ def main():
print "Plugin Enabled"
else:
print "Plugin Disabled"
- except errors.LDAPError, lde:
+ except errors.LDAPError as lde:
print "An error occurred while talking to the server."
print lde
@@ -146,7 +146,7 @@ def main():
else:
entry['nsslapd-pluginenabled'] = ['on']
conn.update_entry(entry)
- except errors.ExecutionError, lde:
+ except errors.ExecutionError as lde:
print "An error occurred while talking to the server."
print lde
retval = 1
@@ -160,7 +160,7 @@ def main():
print >>sys.stderr, "The NIS plugin is configured, cannot disable compatibility."
print >>sys.stderr, "Run 'ipa-nis-manage disable' first."
retval = 2
- except errors.ExecutionError, lde:
+ except errors.ExecutionError as lde:
print "An error occurred while talking to the server."
print lde
retval = 1
@@ -177,11 +177,11 @@ def main():
entry['nsslapd-pluginenabled'] = ['off']
conn.update_entry(entry)
- except errors.DatabaseError, dbe:
+ except errors.DatabaseError as dbe:
print "An error occurred while talking to the server."
print dbe
retval = 1
- except errors.ExecutionError, lde:
+ except errors.ExecutionError as lde:
print "An error occurred while talking to the server."
print lde
retval = 1