summaryrefslogtreecommitdiffstats
path: root/ipapython/certmonger.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/certmonger.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/certmonger.py')
-rw-r--r--ipapython/certmonger.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipapython/certmonger.py b/ipapython/certmonger.py
index 3a2907d83..1371c215d 100644
--- a/ipapython/certmonger.py
+++ b/ipapython/certmonger.py
@@ -212,7 +212,7 @@ def get_request_value(request_id, directive):
"""
try:
request = _get_request(dict(nickname=request_id))
- except RuntimeError, e:
+ except RuntimeError as e:
root_logger.error('Failed to get request: %s' % e)
raise
if request:
@@ -240,7 +240,7 @@ def get_request_id(criteria):
"""
try:
request = _get_request(criteria)
- except RuntimeError, e:
+ except RuntimeError as e:
root_logger.error('Failed to get request: %s' % e)
raise
if request:
@@ -270,7 +270,7 @@ def add_request_value(request_id, directive, value):
"""
try:
request = _get_request({'nickname': request_id})
- except RuntimeError, e:
+ except RuntimeError as e:
root_logger.error('Failed to get request: %s' % e)
raise
if request:
@@ -356,7 +356,7 @@ def start_tracking(nickname, secdir, password_file=None, command=None):
if result[0]:
request = _cm_dbus_object(cm.bus, cm, result[1], DBUS_CM_REQUEST_IF,
DBUS_CM_IF, True)
- except TypeError, e:
+ except TypeError as e:
root_logger.error('Failed to add new request.')
raise
return request.prop_if.Get(DBUS_CM_REQUEST_IF, 'nickname')
@@ -378,7 +378,7 @@ def stop_tracking(secdir, request_id=None, nickname=None):
criteria['cert-nickname'] = nickname
try:
request = _get_request(criteria)
- except RuntimeError, e:
+ except RuntimeError as e:
root_logger.error('Failed to get request: %s' % e)
raise
if request: