summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2011-07-18 13:36:47 +0200
committerMartin Kosek <mkosek@redhat.com>2011-07-19 12:30:47 +0200
commitc09f116f4331175b3fb01f0bd62e78ef47fab716 (patch)
tree2502a418d712e9f90bc4c63d1d3ea3f84613504e /install
parent9869b0971d98457fce181c6de78c173e1b5ebff1 (diff)
downloadfreeipa-c09f116f4331175b3fb01f0bd62e78ef47fab716.zip
freeipa-c09f116f4331175b3fb01f0bd62e78ef47fab716.tar.gz
freeipa-c09f116f4331175b3fb01f0bd62e78ef47fab716.tar.xz
Clean up of IP address checks in install scripts.
Fixes ipa-dns-install incorrect warning. ticket 1486
Diffstat (limited to 'install')
-rwxr-xr-xinstall/tools/ipa-dns-install12
-rwxr-xr-xinstall/tools/ipa-replica-install4
-rwxr-xr-xinstall/tools/ipa-server-install22
3 files changed, 11 insertions, 27 deletions
diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install
index 7c83dc8..da70c85 100755
--- a/install/tools/ipa-dns-install
+++ b/install/tools/ipa-dns-install
@@ -112,13 +112,11 @@ def main():
ip = options.ip_address
else:
hostaddr = resolve_host(api.env.host)
- ip = hostaddr and ipautil.CheckedIPAddress(hostaddr)
-
- try:
- verify_ip_address(ip)
- except Exception, e:
- print "Error: Invalid IP Address %s: %s" % (ip, e)
- ip = None
+ try:
+ ip = hostaddr and ipautil.CheckedIPAddress(hostaddr, match_local=True)
+ except Exception, e:
+ print "Error: Invalid IP Address %s: %s" % (ip, e)
+ ip = None
if not ip:
if options.unattended:
diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install
index d499754..6531421 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -186,7 +186,7 @@ def install_bind(config, options):
ip_address = resolve_host(config.host_name)
if not ip_address:
sys.exit("Unable to resolve IP address for host name")
- ip = installutils.parse_ip_address(ip_address)
+ ip = ipautil.CheckedIPAddress(ip_address, match_local=True)
ip_address = str(ip)
if options.reverse_zone:
@@ -225,7 +225,7 @@ def install_dns_records(config, options):
ip_address = resolve_host(config.host_name)
if not ip_address:
sys.exit("Unable to resolve IP address for host name")
- ip = installutils.parse_ip_address(ip_address)
+ ip = ipautil.CheckedIPAddress(ip_address, match_local=True)
ip_address = str(ip)
reverse_zone = bindinstance.find_reverse_zone(ip)
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 316fc67..8f8100b 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -628,20 +628,11 @@ def main():
if hostaddr is not None:
ip = CheckedIPAddress(hostaddr, match_local=True)
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 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 ip is None:
+ print "Unable to resolve IP address for host name"
+ if options.unattended:
+ sys.exit(1)
if options.ip_address:
if options.ip_address != ip and not options.setup_dns:
@@ -651,11 +642,6 @@ def main():
return 1
ip = options.ip_address
- 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)