fix postinstall

This commit is contained in:
Kload 2013-11-20 23:40:20 +01:00
parent c16c9160b3
commit 8ca9f69691
2 changed files with 33 additions and 30 deletions

View file

@ -277,6 +277,10 @@ class YunoHostLDAP(Singleton):
elif self.pwd: elif self.pwd:
pass pass
else: else:
try:
with open('/etc/yunohost/passwd') as f:
self.pwd = f.read()
except IOError:
need_password = True need_password = True
while need_password: while need_password:
try: try:

View file

@ -112,7 +112,6 @@ def http_exec(request, **kwargs):
raise YunoHostError(168, _('Function not yet implemented : ') + dict['function'].split('.')[1]) raise YunoHostError(168, _('Function not yet implemented : ') + dict['function'].split('.')[1])
# Execute requested function # Execute requested function
with YunoHostLDAP(password=request.getPassword()):
try: try:
with open('/var/run/yunohost.pid', 'r'): with open('/var/run/yunohost.pid', 'r'):
raise YunoHostError(1, _("A YunoHost command is already running")) raise YunoHostError(1, _("A YunoHost command is already running"))