diff options
author | Martin Nagy <mnagy@redhat.com> | 2009-11-23 09:15:35 +0100 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-01-21 17:37:24 -0500 |
commit | d53df67c953143b65dc619b59656158cb55185fc (patch) | |
tree | 03bf65140479c727341025a108ad1997a0b48ca2 /install | |
parent | 5f5eb2fe13f792faff98452879fa43777690b114 (diff) | |
download | freeipa-d53df67c953143b65dc619b59656158cb55185fc.tar.gz freeipa-d53df67c953143b65dc619b59656158cb55185fc.tar.xz freeipa-d53df67c953143b65dc619b59656158cb55185fc.zip |
Move some functions from ipa-server-install into installutils
We will need these functions in the new upcoming ipa-dns-install
command.
Diffstat (limited to 'install')
-rwxr-xr-x | install/tools/ipa-server-install | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install index 94c385032..43095a499 100755 --- a/install/tools/ipa-server-install +++ b/install/tools/ipa-server-install @@ -268,59 +268,6 @@ def resolve_host(host_name): print "Unable to lookup the IP address of the provided host" return ip -def verify_ip_address(ip): - is_ok = True - try: - socket.inet_pton(socket.AF_INET, ip) - except: - try: - socket.inet_pton(socket.AF_INET6, ip) - except: - print "Unable to verify IP address" - is_ok = False - return is_ok - -def read_ip_address(host_name): - while True: - ip = user_input("Please provide the IP address to be used for this host name", allow_empty = False) - - if ip == "127.0.0.1" or ip == "::1": - print "The IPA Server can't use localhost as a valid IP" - continue - - if not verify_ip_address(ip): - continue - - print "Adding ["+ip+" "+host_name+"] to your /etc/hosts file" - fstore.backup_file("/etc/hosts") - hosts_fd = open('/etc/hosts', 'r+') - hosts_fd.seek(0, 2) - hosts_fd.write(ip+'\t'+host_name+' '+host_name.split('.')[0]+'\n') - hosts_fd.close() - - return ip - -def read_dns_forwarders(): - addrs = [] - while True: - ip = user_input("Enter IP address for a DNS forwarder (empty to stop)", allow_empty=True) - - if not ip: - break - if ip == "127.0.0.1" or ip == "::1": - print "You cannot use localhost as a DNS forwarder" - continue - if not verify_ip_address(ip): - continue - - print "DNS forwarder %s added" % ip - addrs.append(ip) - - if not addrs: - print "No DNS forwarders configured" - - return addrs - def read_ds_user(): print "The server must run as a specific user in a specific group." print "It is strongly recommended that this user should have no privileges" @@ -630,7 +577,7 @@ def main(): return 1 if not ip: - ip = read_ip_address(host_name) + ip = read_ip_address(host_name, fstore) ip_address = ip print "The IPA Master Server will be configured with" |