Make the DNS forwarders interactive input less confusing

Fixes #558984
This commit is contained in:
Martin Nagy 2010-02-08 19:31:57 +01:00 committed by Rob Crittenden
parent a292e9901b
commit f52c671ca1

View File

@ -151,19 +151,23 @@ def read_ip_address(host_name, fstore):
def read_dns_forwarders(): def read_dns_forwarders():
addrs = [] addrs = []
while True: if ipautil.user_input("Do you wish to configure DNS forwarders?", False):
ip = ipautil.user_input("Enter IP address for a DNS forwarder (empty to stop)", allow_empty=True) print "Please enter the IP addresses of DNS forwarders that you want to use."
print "After you are done, enter a blank line to stop."
if not ip: while True:
break ip = ipautil.user_input("Enter IP address for a DNS forwarder",
if ip == "127.0.0.1" or ip == "::1": allow_empty=True)
print "You cannot use localhost as a DNS forwarder" if not ip:
continue break
if not verify_ip_address(ip): if ip == "127.0.0.1" or ip == "::1":
continue print "You cannot use localhost as a DNS forwarder"
continue
if not verify_ip_address(ip):
continue
print "DNS forwarder %s added" % ip print "DNS forwarder %s added" % ip
addrs.append(ip) addrs.append(ip)
if not addrs: if not addrs:
print "No DNS forwarders configured" print "No DNS forwarders configured"