From 5adba572ef53f59d0548e914f15a0eb91ab0ac15 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 5 Feb 2020 21:30:12 +0100 Subject: radius: T1990: raise ConfigError in os exception handler --- src/conf_mode/system-login-radius.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/conf_mode/system-login-radius.py b/src/conf_mode/system-login-radius.py index 52010b6ea..8f19bae65 100755 --- a/src/conf_mode/system-login-radius.py +++ b/src/conf_mode/system-login-radius.py @@ -133,8 +133,10 @@ def apply(radius): /etc/nsswitch.conf" os.system(cmd) - except: - print('RADIUS configuration failed') + + except Exception as e: + raise ConfigError('RADIUS configuration failed: {}'.format(e)) + else: try: # Disable RADIUS in PAM @@ -147,8 +149,9 @@ def apply(radius): /etc/nsswitch.conf" os.system(cmd) - except: - print('Removing RADIUS configuration failed') + + except Exception as e: + raise ConfigError('Removing RADIUS configuration failed'.format(e)) return None -- cgit v1.2.3