From 218062a8903864cfb35e298f21c19a7b7a30adb3 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 5 Feb 2020 20:53:56 +0100 Subject: user: T1948: raise ConfigError in os exception handler --- src/conf_mode/system-login-user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/system-login-user.py b/src/conf_mode/system-login-user.py index c7ed96dcf..73fda1b05 100755 --- a/src/conf_mode/system-login-user.py +++ b/src/conf_mode/system-login-user.py @@ -203,7 +203,7 @@ def apply(login): os.chmod(key_file, S_IRUSR | S_IWUSR) except Exception as e: - print('Adding user "{}" raised an exception: {}'.format(user['name'], e)) + raise ConfigError('Adding user "{}" raised an exception: {}'.format(user['name'], e)) for user in login['del_users']: try: @@ -211,7 +211,7 @@ def apply(login): # Remove user account but leave home directory to be safe os.system('userdel {}'.format(user)) except Exception as e: - print('Deleting user "{}" raised an exception'.format(user)) + raise ConfigError('Deleting user "{}" raised an exception: {}'.format(user, e)) return None -- cgit v1.2.3