From 6149e6c6deba4664cc2e3fa4008efd1b0d823627 Mon Sep 17 00:00:00 2001 From: opi Date: Sun, 28 Aug 2016 15:42:47 +0200 Subject: [PATCH] [fix] Write SSOwat configuration file only if needed. --- src/yunohost/user.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/yunohost/user.py b/src/yunohost/user.py index 4cef87429..51c87f59b 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -185,13 +185,12 @@ def user_create(auth, username, firstname, lastname, mail, password, if 'redirected_urls' in ssowat_conf and '/' in ssowat_conf['redirected_urls']: del ssowat_conf['redirected_urls']['/'] - - 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')) + 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')) if auth.add(rdn, attr_dict):