summaryrefslogtreecommitdiffstats
path: root/install/restart_scripts
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 /install/restart_scripts
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 'install/restart_scripts')
-rw-r--r--install/restart_scripts/renew_ca_cert12
-rw-r--r--install/restart_scripts/renew_ra_cert2
-rw-r--r--install/restart_scripts/restart_dirsrv2
-rw-r--r--install/restart_scripts/restart_httpd2
-rw-r--r--install/restart_scripts/stop_pkicad2
5 files changed, 10 insertions, 10 deletions
diff --git a/install/restart_scripts/renew_ca_cert b/install/restart_scripts/renew_ca_cert
index 86f5765b7..8ad0473b5 100644
--- a/install/restart_scripts/renew_ca_cert
+++ b/install/restart_scripts/renew_ca_cert
@@ -56,7 +56,7 @@ def _main():
syslog.LOG_NOTICE, "Stopping %s" % dogtag_service.service_name)
try:
dogtag_service.stop(dogtag_instance)
- except Exception, e:
+ except Exception as e:
syslog.syslog(
syslog.LOG_ERR,
"Cannot stop %s: %s" % (dogtag_service.service_name, e))
@@ -142,7 +142,7 @@ def _main():
try:
conn = ldap2(api)
conn.connect(ccache=ccache_filename)
- except Exception, e:
+ except Exception as e:
syslog.syslog(
syslog.LOG_ERR, "Failed to connect to LDAP: %s" % e)
else:
@@ -152,7 +152,7 @@ def _main():
certstore.update_ca_cert(conn, api.env.basedn, cert)
except errors.EmptyModlist:
pass
- except Exception, e:
+ except Exception as e:
syslog.syslog(
syslog.LOG_ERR,
"Updating CA certificate failed: %s" % e)
@@ -163,7 +163,7 @@ def _main():
ca_certs = certstore.get_ca_certs(
conn, api.env.basedn, api.env.realm, False,
filter_subject=ca_issuer)
- except Exception, e:
+ except Exception as e:
syslog.syslog(
syslog.LOG_ERR,
"Failed to get external CA certificates from LDAP: "
@@ -185,7 +185,7 @@ def _main():
try:
db.add_cert(ca_cert, nick, flags)
- except ipautil.CalledProcessError, e:
+ except ipautil.CalledProcessError as e:
syslog.syslog(
syslog.LOG_ERR,
"Failed to add certificate %s" % ca_nick)
@@ -204,7 +204,7 @@ def _main():
'Starting %s' % dogtag_service.service_name)
try:
dogtag_service.start(dogtag_instance)
- except Exception, e:
+ except Exception as e:
syslog.syslog(
syslog.LOG_ERR,
"Cannot start %s: %s" % (dogtag_service.service_name, e))
diff --git a/install/restart_scripts/renew_ra_cert b/install/restart_scripts/renew_ra_cert
index 1f8fcae6f..24b8ba477 100644
--- a/install/restart_scripts/renew_ra_cert
+++ b/install/restart_scripts/renew_ra_cert
@@ -67,7 +67,7 @@ def _main():
syslog.syslog(syslog.LOG_NOTICE, "Restarting httpd")
try:
services.knownservices.httpd.restart()
- except Exception, e:
+ except Exception as e:
syslog.syslog(syslog.LOG_ERR, "Cannot restart httpd: %s" % e)
else:
syslog.syslog(syslog.LOG_NOTICE, "Restarted httpd")
diff --git a/install/restart_scripts/restart_dirsrv b/install/restart_scripts/restart_dirsrv
index 723644215..856729b5c 100644
--- a/install/restart_scripts/restart_dirsrv
+++ b/install/restart_scripts/restart_dirsrv
@@ -40,7 +40,7 @@ def _main():
try:
services.knownservices.dirsrv.restart(instance)
- except Exception, e:
+ except Exception as e:
syslog.syslog(syslog.LOG_ERR, "Cannot restart dirsrv (instance: '%s'): %s" % (instance, str(e)))
diff --git a/install/restart_scripts/restart_httpd b/install/restart_scripts/restart_httpd
index f060a3091..50348d4ef 100644
--- a/install/restart_scripts/restart_httpd
+++ b/install/restart_scripts/restart_httpd
@@ -30,7 +30,7 @@ def _main():
try:
services.knownservices.httpd.restart()
- except Exception, e:
+ except Exception as e:
syslog.syslog(syslog.LOG_ERR, "Cannot restart httpd: %s" % str(e))
diff --git a/install/restart_scripts/stop_pkicad b/install/restart_scripts/stop_pkicad
index 871e5e761..7a238706d 100644
--- a/install/restart_scripts/stop_pkicad
+++ b/install/restart_scripts/stop_pkicad
@@ -41,7 +41,7 @@ def main():
syslog.syslog(syslog.LOG_NOTICE, "Stopping %s" % dogtag_service.service_name)
try:
dogtag_service.stop(dogtag_instance)
- except Exception, e:
+ except Exception as e:
syslog.syslog(
syslog.LOG_ERR, "Cannot stop %s: %s" % (dogtag_service.service_name, e))
else: