diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-07-30 16:49:29 +0200 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2015-08-12 18:17:23 +0200 |
commit | 27dabb45282911e375336f75934af9dd6cc5d963 (patch) | |
tree | 3c8fe5255d60613fa9cd14d053b3688feed740c9 /install/certmonger | |
parent | a651be3eec2a08bd2865b16b0eed767db69aab0f (diff) | |
download | freeipa-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 'install/certmonger')
-rwxr-xr-x | install/certmonger/dogtag-ipa-ca-renew-agent-submit | 6 | ||||
-rwxr-xr-x | install/certmonger/ipa-server-guard | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/install/certmonger/dogtag-ipa-ca-renew-agent-submit b/install/certmonger/dogtag-ipa-ca-renew-agent-submit index e833a3187..c6fb2deb9 100755 --- a/install/certmonger/dogtag-ipa-ca-renew-agent-submit +++ b/install/certmonger/dogtag-ipa-ca-renew-agent-submit @@ -213,7 +213,7 @@ def store_cert(): conn.add_entry(entry) except errors.EmptyModlist: pass - except Exception, e: + except Exception as e: attempts += 1 if attempts < 10: syslog.syslog( @@ -365,7 +365,7 @@ def export_csr(): try: with open(csr_file, 'wb') as f: f.write(csr) - except Exception, e: + except Exception as e: return (UNREACHABLE, "Failed to write %s: %s" % (csr_file, e)) return (ISSUED, cert) @@ -464,7 +464,7 @@ def main(): try: sys.exit(main()) -except Exception, e: +except Exception as e: syslog.syslog(syslog.LOG_ERR, traceback.format_exc()) print "Internal error" sys.exit(UNREACHABLE) diff --git a/install/certmonger/ipa-server-guard b/install/certmonger/ipa-server-guard index 5e31d89b7..cd6654a09 100755 --- a/install/certmonger/ipa-server-guard +++ b/install/certmonger/ipa-server-guard @@ -49,7 +49,7 @@ def main(): try: sys.exit(main()) -except Exception, e: +except Exception as e: syslog.syslog(syslog.LOG_ERR, traceback.format_exc()) print "Internal error" sys.exit(3) |