diff options
author | Jan Cholasta <jcholast@redhat.com> | 2011-07-18 13:36:47 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-07-19 12:30:47 +0200 |
commit | c09f116f4331175b3fb01f0bd62e78ef47fab716 (patch) | |
tree | 2502a418d712e9f90bc4c63d1d3ea3f84613504e /ipaserver/install/installutils.py | |
parent | 9869b0971d98457fce181c6de78c173e1b5ebff1 (diff) | |
download | freeipa-c09f116f4331175b3fb01f0bd62e78ef47fab716.tar.gz freeipa-c09f116f4331175b3fb01f0bd62e78ef47fab716.tar.xz freeipa-c09f116f4331175b3fb01f0bd62e78ef47fab716.zip |
Clean up of IP address checks in install scripts.
Fixes ipa-dns-install incorrect warning.
ticket 1486
Diffstat (limited to 'ipaserver/install/installutils.py')
-rw-r--r-- | ipaserver/install/installutils.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py index ba49eb8b..c6e8641e 100644 --- a/ipaserver/install/installutils.py +++ b/ipaserver/install/installutils.py @@ -163,15 +163,6 @@ def verify_fqdn(host_name,no_host_dns=False): else: print "Warning: Hostname (%s) not found in DNS" % host_name -def parse_ip_address(addr, match_local=True, parse_netmask=True): - ip = ipautil.CheckedIPAddress(addr, match_local=match_local, parse_netmask=parse_netmask) - if match_local and not ip.is_local(): - print "Warning: No network interface matches IP address %s" % addr - return ip - -def verify_ip_address(addr, match_local=True, parse_netmask=True): - ip = parse_ip_address(addr, match_local, parse_netmask) - def record_in_hosts(ip, host_name, file="/etc/hosts"): hosts = open(file, 'r').readlines() for line in hosts: @@ -204,7 +195,7 @@ def read_ip_address(host_name, fstore): while True: ip = ipautil.user_input("Please provide the IP address to be used for this host name", allow_empty = False) try: - ip_parsed = parse_ip_address(ip) + ip_parsed = ipautil.CheckedIPAddress(ip, match_local=True) except Exception, e: print "Error: Invalid IP Address %s: %s" % (ip, e) continue @@ -229,7 +220,7 @@ def read_dns_forwarders(): if not ip: break try: - ip_parsed = parse_ip_address(ip, match_local=False, parse_netmask=False) + ip_parsed = ipautil.CheckedIPAddress(ip, parse_netmask=False) except Exception, e: print "Error: Invalid IP Address %s: %s" % (ip, e) print "DNS forwarder %s not added" % ip |