From 7f981076019b17082eb061c2fc2e2f2ff140cca1 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 15 Feb 2020 19:40:31 +0100 Subject: snmp: T2042: stricter validation when deleting SNMP in combination with LLDP A consistency check was missing to prevent deleting the SNMP configuration but still setting "service lldp snmp enable". --- src/conf_mode/snmp.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/conf_mode/snmp.py') diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index b0ceb22b4..e6253b2a8 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -537,6 +537,11 @@ def get_config(): def verify(snmp): if snmp is None: + # we can not delete SNMP when LLDP is configured with SNMP + conf = Config() + if conf.exists('service lldp snmp enable'): + raise ConfigError('Can not delete SNMP service, as LLDP still uses SNMP!') + return None ### check if the configured script actually exist -- cgit v1.2.3