summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ipa_backup.py
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 /ipaserver/install/ipa_backup.py
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 'ipaserver/install/ipa_backup.py')
-rw-r--r--ipaserver/install/ipa_backup.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py
index 685c618d8..36f666044 100644
--- a/ipaserver/install/ipa_backup.py
+++ b/ipaserver/install/ipa_backup.py
@@ -314,7 +314,7 @@ class Backup(admintool.AdminTool):
finally:
try:
os.chdir(cwd)
- except Exception, e:
+ except Exception as e:
self.log.error('Cannot change directory to %s: %s' % (cwd, e))
shutil.rmtree(self.top_dir)
@@ -368,7 +368,7 @@ class Backup(admintool.AdminTool):
try:
pw_name = pwd.getpwuid(os.geteuid()).pw_name
self._conn.do_external_bind(pw_name)
- except Exception, e:
+ except Exception as e:
self.log.error("Unable to bind to LDAP server %s: %s" %
(self._conn.host, e))
@@ -411,7 +411,7 @@ class Backup(admintool.AdminTool):
try:
conn.add_entry(ent)
- except Exception, e:
+ except Exception as e:
raise admintool.ScriptError('Unable to add LDIF task: %s'
% e)
@@ -459,7 +459,7 @@ class Backup(admintool.AdminTool):
try:
conn.add_entry(ent)
- except Exception, e:
+ except Exception as e:
raise admintool.ScriptError('Unable to to add backup task: %s'
% e)
@@ -523,7 +523,7 @@ class Backup(admintool.AdminTool):
except errors.NetworkError:
self.log.critical(
"Unable to obtain list of master services, continuing anyway")
- except Exception, e:
+ except Exception as e:
self.log.error("Failed to read services from '%s': %s" %
(conn.host, e))
else: