e.strerror don't always exists, use str(e) instead

This commit is contained in:
Alexandre Aubin 2018-07-02 14:32:41 +02:00
parent d1ac2f218b
commit 36c8d1a787

View file

@ -329,7 +329,7 @@ def tools_postinstall(domain, password, ignore_dyndns=False):
ssowat_conf = json.loads(str(json_conf.read()))
except ValueError as e:
raise MoulinetteError(errno.EINVAL,
m18n.n('ssowat_persistent_conf_read_error', error=e.strerror))
m18n.n('ssowat_persistent_conf_read_error', error=str(e)))
except IOError:
ssowat_conf = {}
@ -343,7 +343,7 @@ def tools_postinstall(domain, password, ignore_dyndns=False):
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))
m18n.n('ssowat_persistent_conf_write_error', error=str(e)))
os.system('chmod 644 /etc/ssowat/conf.json.persistent')