diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-02-15 19:40:31 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-02-15 19:40:31 +0100 |
commit | 7f981076019b17082eb061c2fc2e2f2ff140cca1 (patch) | |
tree | f540cead0561f92c0728fe42007ba5dbc05afcb0 /src | |
parent | 3735e8f6296d61a7e7927620a0fbfc73e88743f5 (diff) | |
download | vyos-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')
-rwxr-xr-x | src/conf_mode/snmp.py | 5 |
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 |