summaryrefslogtreecommitdiffstats
path: root/ipapython/certdb.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 /ipapython/certdb.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 'ipapython/certdb.py')
-rw-r--r--ipapython/certdb.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipapython/certdb.py b/ipapython/certdb.py
index e3238c846..d6de01100 100644
--- a/ipapython/certdb.py
+++ b/ipapython/certdb.py
@@ -178,7 +178,7 @@ class NSSDatabase(object):
args = args + ["-w", paths.DEV_STDIN]
try:
ipautil.run(args, stdin=pkcs12_passwd)
- except ipautil.CalledProcessError, e:
+ except ipautil.CalledProcessError as e:
if e.returncode == 17:
raise RuntimeError("incorrect password for pkcs#12 file %s" %
pkcs12_filename)
@@ -390,7 +390,7 @@ class NSSDatabase(object):
try:
self.run_certutil(["-M", "-n", root_nickname,
"-t", trust_flags])
- except ipautil.CalledProcessError, e:
+ except ipautil.CalledProcessError as e:
raise RuntimeError(
"Setting trust on %s failed" % root_nickname)
@@ -470,7 +470,7 @@ class NSSDatabase(object):
intended_usage = nss.certificateUsageSSLServer
try:
approved_usage = cert.verify_now(certdb, True, intended_usage)
- except NSPRError, e:
+ except NSPRError as e:
if e.errno != -8102:
raise ValueError(e.strerror)
approved_usage = 0
@@ -504,7 +504,7 @@ class NSSDatabase(object):
intended_usage = nss.certificateUsageSSLCA
try:
approved_usage = cert.verify_now(certdb, True, intended_usage)
- except NSPRError, e:
+ except NSPRError as e:
if e.errno != -8102: # SEC_ERROR_INADEQUATE_KEY_USAGE
raise ValueError(e.strerror)
approved_usage = 0