summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-05-31 12:51:38 +0200
committerMartin Kosek <mkosek@redhat.com>2011-06-10 08:29:14 +0200
commit915235859cb67d4f350ff506b435586fd15505e7 (patch)
tree6cd153414ded558f5ed3e987830469d99a6b321d /install
parenta26fb5aacafa91bd67061cb85bc9f0c88b735604 (diff)
downloadfreeipa-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')
-rwxr-xr-xinstall/tools/ipa-dns-install9
-rwxr-xr-xinstall/tools/ipa-replica-prepare5
-rwxr-xr-xinstall/tools/ipa-server-install21
3 files changed, 23 insertions, 12 deletions
diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install
index 91edcca8a..39998ac47 100755
--- a/install/tools/ipa-dns-install
+++ b/install/tools/ipa-dns-install
@@ -108,7 +108,14 @@ def main():
else:
hostaddr = resolve_host(api.env.host)
ip_address = hostaddr and ipautil.CheckedIPAddress(hostaddr)
- if not ip_address or not verify_ip_address(ip_address):
+
+ try:
+ verify_ip_address(ip_address)
+ except Exception, e:
+ print "Error: Invalid IP Address %s: %s" % (ip_address, e)
+ ip_address = None
+
+ if not ip_address:
if options.unattended:
sys.exit("Unable to resolve IP address for host name")
else:
diff --git a/install/tools/ipa-replica-prepare b/install/tools/ipa-replica-prepare
index df44934de..cd13f5d93 100755
--- a/install/tools/ipa-replica-prepare
+++ b/install/tools/ipa-replica-prepare
@@ -78,11 +78,6 @@ def parse_options():
if cnt > 0 and cnt < num:
parser.error("All PKCS#12 options are required if any are used.")
- if options.ip_address:
- if not installutils.verify_ip_address(options.ip_address, match_local=False):
- parser.error("Bad IP address")
- sys.exit(1)
-
if len(args) != 1:
parser.error("must provide the fully-qualified name of the replica")
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)