diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2010-11-08 23:13:48 +0100 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-11-22 09:51:07 -0500 |
commit | 57e1edd052dda284be87e29e1e839af4a9324faf (patch) | |
tree | 00fa2924e12c309d6cef25056feed37212ef8cd7 /install/tools/ipa-server-certinstall | |
parent | 3e540272c69c9697a52a0e2d04ed3c2ae93740f4 (diff) | |
download | freeipa-57e1edd052dda284be87e29e1e839af4a9324faf.tar.gz freeipa-57e1edd052dda284be87e29e1e839af4a9324faf.tar.xz freeipa-57e1edd052dda284be87e29e1e839af4a9324faf.zip |
Use sys.exit to quit scripts
Instead of print and return, use sys.exit() to quit scripts with an
error message and a non zero return code.
https://fedorahosted.org/freeipa/ticket/425
Diffstat (limited to 'install/tools/ipa-server-certinstall')
-rwxr-xr-x | install/tools/ipa-server-certinstall | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/install/tools/ipa-server-certinstall b/install/tools/ipa-server-certinstall index 9d69853e5..4b460535d 100755 --- a/install/tools/ipa-server-certinstall +++ b/install/tools/ipa-server-certinstall @@ -156,9 +156,8 @@ def main(): os.chown(dirname + "/secmod.db", 0, pent.pw_gid ) except Exception, e: - print "an unexpected error occurred: %s" % str(e) - traceback.print_exc() - return 1 + traceback.print_exc(file=sys.stderr) + sys.exit("an unexpected error occurred: %s" % str(e)) return 0 |