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-dns-install | |
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-dns-install')
-rwxr-xr-x | install/tools/ipa-dns-install | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install index b7db1be0d..5604931a5 100755 --- a/install/tools/ipa-dns-install +++ b/install/tools/ipa-dns-install @@ -80,8 +80,7 @@ def main(): safe_options, options = parse_options() if os.getegid() != 0: - print "Must be root to setup server" - return 1 + sys.exit("Must be root to setup server") standard_logging_setup("/var/log/ipaserver-install.log", options.debug, filemode='a') print "\nThe log file for this installation can be found in /var/log/ipaserver-install.log" @@ -103,8 +102,7 @@ def main(): # Check bind packages are installed if not bindinstance.check_inst(options.unattended): - print "Aborting installation" - return 1 + sys.exit("Aborting installation") # Initialize the ipalib api cfg = dict( @@ -124,8 +122,7 @@ def main(): ip_address = resolve_host(api.env.host) if not ip_address or not verify_ip_address(ip_address): if options.unattended: - print "Unable to resolve IP address for host name" - return 1 + sys.exit("Unable to resolve IP address for host name") else: ip_address = read_ip_address(api.env.host, fstore) logging.debug("will use ip_address: %s\n", ip_address) |