summaryrefslogtreecommitdiff
path: root/src/conf_mode/system-login-user.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-05 20:53:56 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-05 20:53:56 +0100
commit218062a8903864cfb35e298f21c19a7b7a30adb3 (patch)
tree645d2ab1816d61698a441179c7e587c85eba4401 /src/conf_mode/system-login-user.py
parent6ea62706d09ad2908eb0376ade85b73b4bf93c60 (diff)
downloadvyos-1x-218062a8903864cfb35e298f21c19a7b7a30adb3.tar.gz
vyos-1x-218062a8903864cfb35e298f21c19a7b7a30adb3.zip
user: T1948: raise ConfigError in os exception handler
Diffstat (limited to 'src/conf_mode/system-login-user.py')
-rwxr-xr-xsrc/conf_mode/system-login-user.py4
1 files changed, 2 insertions, 2 deletions
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