summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-01-17 16:36:05 -0500
committerRob Crittenden <rcritten@redhat.com>2008-01-17 16:36:05 -0500
commitaaa3cfd58ca0c62325d7637b67c6711660624f5d (patch)
treec67641da58e50a1b17719d81610206107b8a1a52
parentf45ded96a64f9adebc1a3c6146f1a80b2183324d (diff)
downloadfreeipa-aaa3cfd58ca0c62325d7637b67c6711660624f5d.tar.gz
freeipa-aaa3cfd58ca0c62325d7637b67c6711660624f5d.tar.xz
freeipa-aaa3cfd58ca0c62325d7637b67c6711660624f5d.zip
Fix case where a question was being asked in unattended mode.
Catch permission errors on install. Initialize srv so the error message works if the user presses enter
-rw-r--r--ipa-client/ipa-install/ipa-client-install12
1 files changed, 10 insertions, 2 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 9cc6f6f6b..e499f0e40 100644
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -43,6 +43,7 @@ def parse_options():
parser.add_option("-d", "--debug", dest="debug", action="store_true",
default=False, help="print debugging information")
parser.add_option("-U", "--unattended", dest="unattended",
+ action="store_true",
help="unattended installation never prompts the user")
parser.add_option("-N", "--no-ntp", action="store_false",
help="do not configure ntp", default=True, dest="conf_ntp")
@@ -86,6 +87,7 @@ def main():
ds = ipaclient.ipadiscovery.IPADiscovery()
ret = ds.search()
+ srv = ""
if ret == -10:
print "Can't get the fully qualified name of this host"
print "Please check that the client is properly configured"
@@ -130,7 +132,7 @@ def main():
print "BaseDN: "+ds.getBaseDN()
print "\n"
- if not ask_for_confirmation("Continue to configure the system with these values?"):
+ if not options.unattended and not ask_for_confirmation("Continue to configure the system with these values?"):
return 1
# Configure ipa.conf
@@ -164,7 +166,11 @@ def main():
opts.append({'name':'uri', 'type':'option', 'value':'ldap://'+ds.getServerName()})
opts.append({'name':'empty', 'type':'empty'})
- ldapconf.newConf("/etc/ldap.conf", opts)
+ try:
+ ldapconf.newConf("/etc/ldap.conf", opts)
+ except Exception, e:
+ print "Configuration failed: " + str(e)
+ return 1
#Check if kerberos is already configured properly
krbctx = krbV.default_context()
@@ -232,6 +238,8 @@ def main():
if options.conf_ntp:
ipaclient.ntpconf.config_ntp(ds.getServerName())
+ print "Client configuration complete."
+
return 0
sys.exit(main())