diff options
author | Petr Viktorin <pviktori@redhat.com> | 2012-05-31 14:34:09 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-05-31 14:37:27 +0200 |
commit | 0ca29fac9af4cd437a8536f28ffd25923ec3f8cd (patch) | |
tree | 6804ca5316f511d83ee6898f19eea8b9ef9092ea /install/tools/ipa-upgradeconfig | |
parent | 9e877585e213a9fccec8ff9b3dcb876b2ec65696 (diff) | |
download | freeipa.git-0ca29fac9af4cd437a8536f28ffd25923ec3f8cd.tar.gz freeipa.git-0ca29fac9af4cd437a8536f28ffd25923ec3f8cd.tar.xz freeipa.git-0ca29fac9af4cd437a8536f28ffd25923ec3f8cd.zip |
Move install script error handling to a common function
All of our install/admin scripts had a try/except block calling the
main function and handling common exceptions. These were copy-pasted
from each other and modified to various levels of sophistication.
This refactors them out of installers to a single function, which
includes a final pass/fail message for all of the scripts.
Non-install scripts that set up the same log handler levels for
stderr and log file are not changed, as it's not possible to log
to only the logfile without changing the logger configuration.
https://fedorahosted.org/freeipa/ticket/2071
Diffstat (limited to 'install/tools/ipa-upgradeconfig')
-rw-r--r-- | install/tools/ipa-upgradeconfig | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/install/tools/ipa-upgradeconfig b/install/tools/ipa-upgradeconfig index a2a30249..0cf59f29 100644 --- a/install/tools/ipa-upgradeconfig +++ b/install/tools/ipa-upgradeconfig @@ -305,10 +305,5 @@ def main(): cleanup_kdc(fstore) upgrade_ipa_profile(krbctx.default_realm) -try: - if __name__ == "__main__": - sys.exit(main()) -except SystemExit, e: - sys.exit(e) -except KeyboardInterrupt, e: - sys.exit(1) +if __name__ == '__main__': + installutils.run_script(main, operation_name='ipa-upgradeconfig') |