summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-04-29 14:12:00 -0400
committerRob Crittenden <rcritten@redhat.com>2008-05-08 12:01:38 -0400
commit2bb64e404c9d96532b5619b5801532d96f4ebb1f (patch)
treeeea78038bf09d7b19d0a9d6889c3f1df2fddfbc8
parent570b71372f097ed986f9435d3d9795b21312060f (diff)
downloadfreeipa-2bb64e404c9d96532b5619b5801532d96f4ebb1f.tar.gz
freeipa-2bb64e404c9d96532b5619b5801532d96f4ebb1f.tar.xz
freeipa-2bb64e404c9d96532b5619b5801532d96f4ebb1f.zip
Don't prompt for confirmation of DM password when installing a replica.
It implies that you are setting a new password and you really aren't. Also added a catch for KeyboardInterrupt with instructions on how to recover from a partial install. 441607
-rw-r--r--ipa-server/ipa-install/ipa-replica-install9
-rw-r--r--ipa-server/ipaserver/installutils.py7
2 files changed, 12 insertions, 4 deletions
diff --git a/ipa-server/ipa-install/ipa-replica-install b/ipa-server/ipa-install/ipa-replica-install
index 551b468a6..a881071b7 100644
--- a/ipa-server/ipa-install/ipa-replica-install
+++ b/ipa-server/ipa-install/ipa-replica-install
@@ -54,8 +54,8 @@ def parse_options():
return options, args[0]
-def get_dirman_password():
- return installutils.read_password("Directory Manager (existing master)")
+def get_dirman_password()
+ return installutils.read_password("Directory Manager (existing master)", confirm=False, validate=False)
def expand_info(filename):
top_dir = tempfile.mkdtemp("ipa")
@@ -228,3 +228,8 @@ except Exception, e:
message = message + "\n" + str
logging.debug(message)
sys.exit(1)
+except KeyboardInterrupt:
+ print "Installation cancelled."
+ print "Your system may be partly configured."
+ print "Run /usr/sbin/ipa-server-install --uninstall to clean up."
+ sys.exit(1)
diff --git a/ipa-server/ipaserver/installutils.py b/ipa-server/ipaserver/installutils.py
index 2624ae141..37ee5d6ab 100644
--- a/ipa-server/ipaserver/installutils.py
+++ b/ipa-server/ipaserver/installutils.py
@@ -161,16 +161,19 @@ def standard_logging_setup(log_filename, debug=False):
console.setFormatter(formatter)
logging.getLogger('').addHandler(console)
-def read_password(user):
+def read_password(user, confirm=True, validate=True):
correct = False
pwd = ""
while not correct:
pwd = getpass.getpass(user + " password: ")
if not pwd:
continue
- if len(pwd) < 8:
+ if validate and len(pwd) < 8:
print "Password must be at least 8 characters long"
continue
+ if not confirm:
+ correct = True
+ continue
pwd_confirm = getpass.getpass("Password (confirm): ")
if pwd != pwd_confirm:
print "Password mismatch!"