summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/installutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipa-server/ipaserver/installutils.py')
-rw-r--r--ipa-server/ipaserver/installutils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ipa-server/ipaserver/installutils.py b/ipa-server/ipaserver/installutils.py
index 2624ae14..37ee5d6a 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!"