Fix unattended install

This commit is contained in:
Simo Sorce 2008-02-25 17:16:18 -05:00
parent 3617100849
commit e50f0fdbee

View File

@ -210,20 +210,24 @@ def read_ds_user():
return ds_user
def read_domain_name(domain_name):
def read_domain_name(domain_name, unattended):
print "The domain name has been calculated based on the host name."
print ""
if not unattended:
dn = raw_input("Please confirm the domain name ["+domain_name+"]: ")
print ""
if dn != "":
domain_name = dn
return domain_name
def read_realm_name(domain_name):
def read_realm_name(domain_name, unattended):
print "The kerberos protocol requires a Realm name to be defined."
print "This is typically the domain name converted to uppercase."
print ""
upper_dom = domain_name.upper()
if unattended:
realm_name = upper_dom
else:
realm_name = raw_input("Please provide a realm name ["+upper_dom+"]: ")
print ""
if realm_name == "":
@ -372,10 +376,9 @@ def main():
host_name = read_host_name(host_default)
if not options.domain_name:
domain_name = host_name[host_name.find(".")+1:]
domain_name = read_domain_name(domain_name)
domain_name = read_domain_name(host_name[host_name.find(".")+1:], options.unattended)
else:
realm_name = options.realm_name
domain_name = options.domain_name
# Check we have a public IP that is associated with the hostname
ip = resolve_host(host_name)
@ -423,7 +426,7 @@ def main():
ds_user = options.ds_user
if not options.realm_name:
realm_name = read_realm_name(domain_name)
realm_name = read_realm_name(domain_name, options.unattended)
else:
realm_name = options.realm_name