diff options
author | Petr Viktorin <pviktori@redhat.com> | 2012-09-25 08:35:06 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-09-27 14:43:01 +0200 |
commit | ebfda866dd3a67ca46afc3f8771670d7e496de5f (patch) | |
tree | faffc1ff669eef68b8c8c56e128d25a959e686d8 /ipa-client/ipa-install/ipa-client-install | |
parent | fbfa3b56fa303056d2d18f1a71f5826e37021906 (diff) | |
download | freeipa.git-ebfda866dd3a67ca46afc3f8771670d7e496de5f.tar.gz freeipa.git-ebfda866dd3a67ca46afc3f8771670d7e496de5f.tar.xz freeipa.git-ebfda866dd3a67ca46afc3f8771670d7e496de5f.zip |
Don't use bare except: clauses in ipa-client-install
Instead of `except:`, use `except Exception:`. This means that errors
like KeyboardInterrupt are not handled, letting them terminate the
script as expected.
https://fedorahosted.org/freeipa/ticket/2941
Diffstat (limited to 'ipa-client/ipa-install/ipa-client-install')
-rwxr-xr-x | ipa-client/ipa-install/ipa-client-install | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index a1233fd8..ee8e5831 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -464,13 +464,13 @@ def uninstall(options, env): if nscd.is_installed(): try: nscd.restart() - except: + except Exception: root_logger.warning( "Failed to restart the %s daemon", nscd.service_name) try: nscd.enable() - except: + except Exception: root_logger.warning( "Failed to configure automatic startup of the %s daemon", nscd.service_name) @@ -483,13 +483,13 @@ def uninstall(options, env): if nslcd.is_installed(): try: nslcd.stop() - except: + except Exception: root_logger.warning( "Failed to stop the %s daemon", nslcd.service_name) try: nslcd.disable() - except: + except Exception: root_logger.warning( "Failed to disable automatic startup of the %s daemon", nslcd.service_name) @@ -513,7 +513,7 @@ def uninstall(options, env): restored |= fstore.restore_file("/etc/sysconfig/ntpd") if ntp_step_tickers: restored |= fstore.restore_file("/etc/ntp/step-tickers") - except: + except Exception: pass if not ntp_enabled: @@ -556,7 +556,7 @@ def uninstall(options, env): # Remove the IPA configuration file try: os.remove("/etc/ipa/default.conf") - except: + except Exception: pass root_logger.info("Client uninstall complete.") @@ -836,7 +836,7 @@ def configure_certmonger(fstore, subject_base, cli_realm, hostname, options): subject = DN(('CN', hostname), subject_base) try: run(["ipa-getcert", "request", "-d", "/etc/pki/nssdb", "-n", client_nss_nickname, "-N", str(subject), "-K", principal]) - except: + except Exception: root_logger.error( "%s request for host certificate failed", cmonger.service_name) @@ -1130,7 +1130,7 @@ def do_nsupdate(update_txt): try: os.remove(UPDATE_FILE) - except: + except Exception: pass return result @@ -1490,7 +1490,7 @@ def install(options, env, fstore, statestore): # Remove anything already there so that wget doesn't use its # too-clever renaming feature os.remove("/etc/ipa/ca.crt") - except: + except Exception: pass try: @@ -1729,7 +1729,7 @@ def install(options, env, fstore, statestore): try: os.remove(CCACHE_FILE) - except: + except Exception: pass #Name Server Caching Daemon. Disable for SSSD, use otherwise (if installed) @@ -1742,7 +1742,7 @@ def install(options, env, fstore, statestore): else: nscd_service_action = 'restart' nscd.restart() - except: + except Exception: root_logger.warning("Failed to %s the %s daemon", nscd_service_action, nscd.service_name) if not options.sssd: @@ -1754,7 +1754,7 @@ def install(options, env, fstore, statestore): nscd.disable() else: nscd.enable() - except: + except Exception: if not options.sssd: root_logger.warning( "Failed to configure automatic startup of the %s daemon", @@ -1923,5 +1923,5 @@ except RuntimeError, e: finally: try: os.remove(CCACHE_FILE) - except: + except Exception: pass |