From c229abf2a7db93e0117d6b39de62b9c15150c915 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Fri, 2 Dec 2022 11:58:25 +0000 Subject: T4804: Fix check for PPPoE server local-users We check if local_users is None Check also and empty dict {'access_concentrator': 'vyos-ac', 'authentication': {'local_users': {}, --- python/vyos/configverify.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/vyos') diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index afa0c5b33..8e0ce701e 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -388,8 +388,10 @@ def verify_accel_ppp_base_service(config, local_users=True): """ # vertify auth settings if local_users and dict_search('authentication.mode', config) == 'local': - if dict_search(f'authentication.local_users', config) == None: - raise ConfigError('Authentication mode local requires local users to be configured!') + if (dict_search(f'authentication.local_users', config) is None or + dict_search(f'authentication.local_users', config) == {}): + raise ConfigError( + 'Authentication mode local requires local users to be configured!') for user in dict_search('authentication.local_users.username', config): user_config = config['authentication']['local_users']['username'][user] -- cgit v1.2.3