From 277c081ac05e87bdd06096a0c177d0cd4d51a888 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 Oct 2012 19:52:52 +0200 Subject: [PATCH] fuck. --- yunohost.py | 17 +++++++++-------- yunohost_tools.py | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/yunohost.py b/yunohost.py index 434c6302..c5f4de65 100644 --- a/yunohost.py +++ b/yunohost.py @@ -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")) diff --git a/yunohost_tools.py b/yunohost_tools.py index b0e36215..699a7ec4 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -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']})