From 6e6237e54a1f7a07478ec7c592ea08f71e1b18ce Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Thu, 21 Feb 2008 15:23:29 +0000 Subject: [PATCH] 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 --- ipa-server/ipa-install/ipa-server-install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install index 8f111d213..5a2642dbd 100644 --- a/ipa-server/ipa-install/ipa-server-install +++ b/ipa-server/ipa-install/ipa-server-install @@ -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"