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
This commit is contained in:
Rob Crittenden 2008-04-29 14:12:00 -04:00
parent 570b71372f
commit 2bb64e404c
2 changed files with 12 additions and 4 deletions

View File

@ -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)

View File

@ -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!"