mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Display full exception error message.
This commit is contained in:
parent
6149e6c6de
commit
81e464ce1f
4 changed files with 25 additions and 15 deletions
|
@ -209,8 +209,8 @@
|
|||
"service_unknown": "Unknown service '{service:s}'",
|
||||
"ssowat_conf_generated": "The SSOwat configuration has been generated",
|
||||
"ssowat_conf_updated": "The SSOwat configuration has been updated",
|
||||
"ssowat_persistent_conf_read_error": "Error while reading SSOwat persistent configuration",
|
||||
"ssowat_persistent_conf_write_error": "Error while saving SSOwat persistent configuration",
|
||||
"ssowat_persistent_conf_read_error": "Error while reading SSOwat persistent configuration: {error:s}",
|
||||
"ssowat_persistent_conf_write_error": "Error while saving SSOwat persistent configuration: {error:s}",
|
||||
"system_upgraded": "The system has been upgraded",
|
||||
"system_username_exists": "Username already exists in the system users",
|
||||
"unbackup_app": "App '{app:s}' will not be saved",
|
||||
|
|
|
@ -806,9 +806,9 @@ def app_makedefault(auth, app, domain=None):
|
|||
try:
|
||||
with open('/etc/ssowat/conf.json.persistent') as json_conf:
|
||||
ssowat_conf = json.loads(str(json_conf.read()))
|
||||
except ValueError:
|
||||
except ValueError as e:
|
||||
raise MoulinetteError(errno.EINVAL,
|
||||
m18n.n('ssowat_persistent_conf_read_error'))
|
||||
m18n.n('ssowat_persistent_conf_read_error', error=e.strerror))
|
||||
except IOError:
|
||||
ssowat_conf = {}
|
||||
|
||||
|
@ -817,8 +817,13 @@ def app_makedefault(auth, app, domain=None):
|
|||
|
||||
ssowat_conf['redirected_urls'][domain +'/'] = app_domain + app_path
|
||||
|
||||
with open('/etc/ssowat/conf.json.persistent', 'w+') as f:
|
||||
json.dump(ssowat_conf, f, sort_keys=True, indent=4)
|
||||
try:
|
||||
with open('/etc/ssowat/conf.json.persistent', 'w+') as f:
|
||||
json.dump(ssowat_conf, f, sort_keys=True, indent=4)
|
||||
except IOError as e:
|
||||
raise MoulinetteError(errno.EPERM,
|
||||
m18n.n('ssowat_persistent_conf_write_error', error=e.strerror))
|
||||
|
||||
|
||||
os.system('chmod 644 /etc/ssowat/conf.json.persistent')
|
||||
|
||||
|
|
|
@ -226,9 +226,9 @@ def tools_postinstall(domain, password, ignore_dyndns=False):
|
|||
try:
|
||||
with open('/etc/ssowat/conf.json.persistent') as json_conf:
|
||||
ssowat_conf = json.loads(str(json_conf.read()))
|
||||
except ValueError:
|
||||
except ValueError as e:
|
||||
raise MoulinetteError(errno.EINVAL,
|
||||
m18n.n('ssowat_persistent_conf_read_error'))
|
||||
m18n.n('ssowat_persistent_conf_read_error', error=e.strerror))
|
||||
except IOError:
|
||||
ssowat_conf = {}
|
||||
|
||||
|
@ -237,8 +237,13 @@ def tools_postinstall(domain, password, ignore_dyndns=False):
|
|||
|
||||
ssowat_conf['redirected_urls']['/'] = domain +'/yunohost/admin'
|
||||
|
||||
with open('/etc/ssowat/conf.json.persistent', 'w+') as f:
|
||||
json.dump(ssowat_conf, f, sort_keys=True, indent=4)
|
||||
try:
|
||||
with open('/etc/ssowat/conf.json.persistent', 'w+') as f:
|
||||
json.dump(ssowat_conf, f, sort_keys=True, indent=4)
|
||||
except IOError as e:
|
||||
raise MoulinetteError(errno.EPERM,
|
||||
m18n.n('ssowat_persistent_conf_write_error', error=e.strerror))
|
||||
|
||||
|
||||
os.system('chmod 644 /etc/ssowat/conf.json.persistent')
|
||||
|
||||
|
|
|
@ -177,9 +177,9 @@ def user_create(auth, username, firstname, lastname, mail, password,
|
|||
try:
|
||||
with open('/etc/ssowat/conf.json.persistent') as json_conf:
|
||||
ssowat_conf = json.loads(str(json_conf.read()))
|
||||
except ValueError:
|
||||
except ValueError as e:
|
||||
raise MoulinetteError(errno.EINVAL,
|
||||
m18n.n('ssowat_persistent_conf_read_error'))
|
||||
m18n.n('ssowat_persistent_conf_read_error', error=e.strerror))
|
||||
except IOError:
|
||||
ssowat_conf = {}
|
||||
|
||||
|
@ -188,9 +188,9 @@ def user_create(auth, username, firstname, lastname, mail, password,
|
|||
try:
|
||||
with open('/etc/ssowat/conf.json.persistent', 'w+') as f:
|
||||
json.dump(ssowat_conf, f, sort_keys=True, indent=4)
|
||||
except IOError:
|
||||
raise MoulinetteError(errno.EINVAL,
|
||||
m18n.n('ssowat_persistent_conf_write_error'))
|
||||
except IOError as e:
|
||||
raise MoulinetteError(errno.EPERM,
|
||||
m18n.n('ssowat_persistent_conf_write_error', error=e.strerror))
|
||||
|
||||
|
||||
if auth.add(rdn, attr_dict):
|
||||
|
|
Loading…
Add table
Reference in a new issue