This commit is contained in:
root 2012-10-25 19:52:52 +02:00
parent a6c2e87be1
commit 277c081ac0
2 changed files with 10 additions and 9 deletions

View file

@ -125,14 +125,15 @@ def get_required_args(args, required_args, password=False):
else:
raise Exception #FIX
# Password
if args['password'] is None and 'password' in required_args and password:
if os.isatty(1):
args['password'] = getpass.getpass(colorize(required_args['password'] + ': ', 'cyan'))
pwd2 = getpass.getpass(colorize('Retype ' + required_args['password'][0].lower() + required_args['password'][1:] + ': ', 'cyan'))
if args['password'] != pwd2:
raise YunoHostError(22, _("Passwords doesn't match"))
else:
raise YunoHostError(22, _("Missing arguments"))
if 'password' in required_args and password:
if not args['password']:
if os.isatty(1):
args['password'] = getpass.getpass(colorize(required_args['password'] + ': ', 'cyan'))
pwd2 = getpass.getpass(colorize('Retype ' + required_args['password'][0].lower() + required_args['password'][1:] + ': ', 'cyan'))
if args['password'] != pwd2:
raise YunoHostError(22, _("Passwords doesn't match"))
else:
raise YunoHostError(22, _("Missing arguments"))
except KeyboardInterrupt, EOFError:
raise YunoHostError(125, _("Interrupted, YunoHost not configured"))

View file

@ -173,7 +173,7 @@ def tools_postinstall(args, connections):
raise YunoHostError(17, _("YunoHost is already installed"))
# Initialize YunoHost LDAP base
tools_ldapinit(args, connections)
#tools_ldapinit(args, connections)
# Change LDAP admin password
tools_adminpw({ 'old' : 'yunohost', 'new' : args['password']})