summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-15 19:40:31 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-15 19:40:31 +0100
commit7f981076019b17082eb061c2fc2e2f2ff140cca1 (patch)
treef540cead0561f92c0728fe42007ba5dbc05afcb0 /src/conf_mode
parent3735e8f6296d61a7e7927620a0fbfc73e88743f5 (diff)
downloadvyos-1x-7f981076019b17082eb061c2fc2e2f2ff140cca1.tar.gz
vyos-1x-7f981076019b17082eb061c2fc2e2f2ff140cca1.zip
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".
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/snmp.py5
1 files changed, 5 insertions, 0 deletions
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