mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
committed by
Tomas Babej
parent
a651be3eec
commit
27dabb4528
@@ -48,7 +48,7 @@ def use_keytab(principal, keytab):
|
||||
conn = ldap2(api)
|
||||
conn.connect(ccache=ccache)
|
||||
conn.disconnect()
|
||||
except krbV.Krb5Error, e:
|
||||
except krbV.Krb5Error as e:
|
||||
raise StandardError('Unable to bind to LDAP. Error initializing principal %s in %s: %s' % (principal.name, keytab, str(e)))
|
||||
finally:
|
||||
del os.environ['KRB5CCNAME']
|
||||
@@ -111,7 +111,7 @@ class test_ipagetkeytab(cmdline_test):
|
||||
expected = 'Keytab successfully retrieved and stored in: %s\n' % (
|
||||
self.keytabname)
|
||||
assert expected in err, 'Success message not in output:\n%s' % err
|
||||
except ipautil.CalledProcessError, e:
|
||||
except ipautil.CalledProcessError as e:
|
||||
assert (False)
|
||||
|
||||
def test_3_use(self):
|
||||
@@ -141,7 +141,7 @@ class test_ipagetkeytab(cmdline_test):
|
||||
"""
|
||||
try:
|
||||
use_keytab(self.service_princ, self.keytabname)
|
||||
except StandardError, errmsg:
|
||||
except StandardError as errmsg:
|
||||
assert('Unable to bind to LDAP. Error initializing principal' in str(errmsg))
|
||||
|
||||
def test_9_cleanup(self):
|
||||
|
||||
Reference in New Issue
Block a user