summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/user.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 /ipalib/plugins/user.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 'ipalib/plugins/user.py')
-rw-r--r--ipalib/plugins/user.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ipalib/plugins/user.py b/ipalib/plugins/user.py
index 859939205..121e107c1 100644
--- a/ipalib/plugins/user.py
+++ b/ipalib/plugins/user.py
@@ -974,7 +974,7 @@ class user_status(LDAPQuery):
other_ldap = ldap2(self.api, ldap_uri='ldap://%s' % host)
try:
other_ldap.connect(ccache=os.environ['KRB5CCNAME'])
- except Exception, e:
+ except Exception as e:
self.error("user_status: Connecting to %s failed with %s" % (host, str(e)))
newresult = {'dn': dn}
newresult['server'] = _("%(host)s failed: %(error)s") % dict(host=host, error=str(e))
@@ -994,7 +994,7 @@ class user_status(LDAPQuery):
continue
newtime = time.strptime(newresult[attr][0], '%Y%m%d%H%M%SZ')
newresult[attr][0] = unicode(time.strftime('%Y-%m-%dT%H:%M:%SZ', newtime))
- except Exception, e:
+ except Exception as e:
self.debug("time conversion failed with %s" % str(e))
pass
newresult['server'] = host
@@ -1011,7 +1011,7 @@ class user_status(LDAPQuery):
count += 1
except errors.NotFound:
self.obj.handle_not_found(*keys)
- except Exception, e:
+ except Exception as e:
self.error("user_status: Retrieving status for %s failed with %s" % (dn, str(e)))
newresult = {'dn': dn}
newresult['server'] = _("%(host)s failed") % dict(host=host)