diff options
author | Martin Kosek <mkosek@redhat.com> | 2011-05-31 12:51:38 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-06-10 08:29:14 +0200 |
commit | 915235859cb67d4f350ff506b435586fd15505e7 (patch) | |
tree | 6cd153414ded558f5ed3e987830469d99a6b321d /install/tools/ipa-server-install | |
parent | a26fb5aacafa91bd67061cb85bc9f0c88b735604 (diff) | |
download | freeipa-915235859cb67d4f350ff506b435586fd15505e7.tar.gz freeipa-915235859cb67d4f350ff506b435586fd15505e7.tar.xz freeipa-915235859cb67d4f350ff506b435586fd15505e7.zip |
IPA installation with --no-host-dns fails
--no-host-dns option should allow installing IPA server on a host
without a DNS resolvable name.
Update parse_ip_address and verify_ip_address functions has been
changed not to return None and print error messages in case of
an error, but rather let the Exception be handled by the calling
routine.
https://fedorahosted.org/freeipa/ticket/1246
Diffstat (limited to 'install/tools/ipa-server-install')
-rwxr-xr-x | install/tools/ipa-server-install | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install index a62aa150a..18319bed9 100755 --- a/install/tools/ipa-server-install +++ b/install/tools/ipa-server-install @@ -598,14 +598,20 @@ def main(): if hostaddr is not None: ip = CheckedIPAddress(hostaddr) else: + if not options.ip_address: + print "Unable to resolve IP address for host name" ip = options.ip_address if ip is None and options.unattended: sys.exit("Unable to resolve IP address for host name") - if not verify_ip_address(ip): - ip = None - if options.unattended: - sys.exit(1) + if ip: + try: + verify_ip_address(ip) + except Exception, e: + print "Error: Invalid IP Address %s: %s" % (ip, e) + if options.unattended: + sys.exit(1) + ip = None if options.ip_address: if options.ip_address != ip and not options.setup_dns: @@ -615,8 +621,11 @@ def main(): return 1 ip = options.ip_address - if not verify_ip_address(ip): - return 1 + try: + verify_ip_address(ip) + except Exception, e: + print "Error: Invalid IP Address %s: %s" % (ip, e) + sys.exit(1) if ip is None: ip = read_ip_address(host_name, fstore) |