mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Pretify postinstall
This commit is contained in:
parent
8208245eda
commit
a6f53f2e69
2 changed files with 7 additions and 7 deletions
|
@ -130,8 +130,8 @@ def main():
|
||||||
return error.code
|
return error.code
|
||||||
else:
|
else:
|
||||||
if result is None:
|
if result is None:
|
||||||
result = { 'Notice' : 'No result returned' }
|
pass
|
||||||
if os.isatty(1):
|
elif os.isatty(1):
|
||||||
pretty_print_dict(result)
|
pretty_print_dict(result)
|
||||||
else:
|
else:
|
||||||
print(json.dumps(result))
|
print(json.dumps(result))
|
||||||
|
|
|
@ -44,7 +44,7 @@ def tools_ldapinit(args, connections):
|
||||||
|
|
||||||
yldap.update('cn=admin', admin_dict)
|
yldap.update('cn=admin', admin_dict)
|
||||||
|
|
||||||
return { 'Success' : _("LDAP has been successfully initialized") }
|
win_msg(_("LDAP has been successfully initialized"))
|
||||||
|
|
||||||
|
|
||||||
def tools_adminpw(args):
|
def tools_adminpw(args):
|
||||||
|
@ -74,7 +74,7 @@ def tools_adminpw(args):
|
||||||
result = os.system('ldappasswd -h localhost -D cn=admin,dc=yunohost,dc=org -w "'+ args['old'] +'" -a "'+ args['old'] +'" -s "' + args['new'] + '"')
|
result = os.system('ldappasswd -h localhost -D cn=admin,dc=yunohost,dc=org -w "'+ args['old'] +'" -a "'+ args['old'] +'" -s "' + args['new'] + '"')
|
||||||
|
|
||||||
if result == 0:
|
if result == 0:
|
||||||
return { 'Success' : _("Admin password has been changed") }
|
win_msg(_("Admin password has been changed"))
|
||||||
else:
|
else:
|
||||||
raise YunoHostError(22, _("Invalid password"))
|
raise YunoHostError(22, _("Invalid password"))
|
||||||
|
|
||||||
|
@ -149,9 +149,9 @@ def tools_maindomain(args):
|
||||||
o = os.system('/etc/init.d/ejabberd restart')
|
o = os.system('/etc/init.d/ejabberd restart')
|
||||||
|
|
||||||
if a == b == c == d == e == f == g == h == i == j == k == l == m == n == o:
|
if a == b == c == d == e == f == g == h == i == j == k == l == m == n == o:
|
||||||
return { 'Success' : _("YunoHost main domain has been successfully changed") }
|
win_msg(_("YunoHost main domain has been successfully changed"))
|
||||||
else:
|
else:
|
||||||
return { 'Error' : _("There were a problem during domain changing") }
|
raise YunoHostError(17, _("There were a problem during domain changing"))
|
||||||
|
|
||||||
|
|
||||||
def tools_postinstall(args, connections):
|
def tools_postinstall(args, connections):
|
||||||
|
@ -186,4 +186,4 @@ def tools_postinstall(args, connections):
|
||||||
|
|
||||||
os.system('touch /usr/share/yunohost/yunohost-config/others/installed')
|
os.system('touch /usr/share/yunohost/yunohost-config/others/installed')
|
||||||
|
|
||||||
return { 'Success' : _("YunoHost has been successfully configured") }
|
win_msg(_("YunoHost has been successfully configured"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue