Fix host_name buglet in ipa-server-install

This patch fixes a couple of buglets with read_ip_address():

  1) It writes host_name to /etc/hosts, but isn't currently
     being passed host_name

  2) It doesn't return the IP address even though the caller
     expects it

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
Mark McLoughlin 2008-02-21 15:23:29 +00:00
parent d01da9a566
commit 6e6237e54a

View File

@ -228,9 +228,8 @@ def verify_ip_address(ip):
is_ok = False
return is_ok
def read_ip_address():
askip = True
while askip:
def read_ip_address(host_name):
while True:
ip = raw_input("Please provide the IP address to be used for this host name: ")
if ip == "":
@ -247,7 +246,8 @@ def read_ip_address():
hosts_fd.seek(0, 2)
hosts_fd.write(ip+'\t'+host_name+' '+host_name[:host_name.find('.')]+'\n')
hosts_fd.close()
askip = False
return ip
def port_available(port):
"""Try to bind to a port on the wildcard host
@ -470,7 +470,7 @@ def main():
return "-Fatal Error-"
if not ip:
ip = read_ip_address ()
ip = read_ip_address(host_name)
ip_address = ip
print "The IPA Master Server will be configured with"