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: else:
raise Exception #FIX raise Exception #FIX
# Password # Password
if args['password'] is None and 'password' in required_args and password: if 'password' in required_args and password:
if os.isatty(1): if not args['password']:
args['password'] = getpass.getpass(colorize(required_args['password'] + ': ', 'cyan')) if os.isatty(1):
pwd2 = getpass.getpass(colorize('Retype ' + required_args['password'][0].lower() + required_args['password'][1:] + ': ', 'cyan')) args['password'] = getpass.getpass(colorize(required_args['password'] + ': ', 'cyan'))
if args['password'] != pwd2: pwd2 = getpass.getpass(colorize('Retype ' + required_args['password'][0].lower() + required_args['password'][1:] + ': ', 'cyan'))
raise YunoHostError(22, _("Passwords doesn't match")) if args['password'] != pwd2:
else: raise YunoHostError(22, _("Passwords doesn't match"))
raise YunoHostError(22, _("Missing arguments")) else:
raise YunoHostError(22, _("Missing arguments"))
except KeyboardInterrupt, EOFError: except KeyboardInterrupt, EOFError:
raise YunoHostError(125, _("Interrupted, YunoHost not configured")) 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")) raise YunoHostError(17, _("YunoHost is already installed"))
# Initialize YunoHost LDAP base # Initialize YunoHost LDAP base
tools_ldapinit(args, connections) #tools_ldapinit(args, connections)
# Change LDAP admin password # Change LDAP admin password
tools_adminpw({ 'old' : 'yunohost', 'new' : args['password']}) tools_adminpw({ 'old' : 'yunohost', 'new' : args['password']})