From 0364d44b4ffbcde647807c31e42c3662cc87e2e3 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Mon, 11 Mar 2024 12:32:46 +0200 Subject: snmp: T2998: SNMP v3 oid "exclude" option fix --- src/conf_mode/snmp.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/conf_mode') diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index 0be0da3d1..b300961ff 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -383,6 +383,10 @@ def get_config(): oid_cfg = { 'oid': oid } + if conf.exists('v3 view {0} oid {1} exclude'.format(view, oid)): + oid_cfg['exclude'] = [] + for exclude in conf.return_values('v3 view {0} oid {1} exclude'.format(view, oid)): + oid_cfg['exclude'].append(exclude) view_cfg['oids'].append(oid_cfg) snmp['v3_views'].append(view_cfg) -- cgit v1.2.3 From 1fb746332602fd53eb5412c8f3c7fc38c09b7d26 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Thu, 14 Mar 2024 15:12:08 +0200 Subject: snmp: T2998: updated snmp.py --- src/conf_mode/snmp.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index b300961ff..7b3f9cbb7 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -384,9 +384,7 @@ def get_config(): 'oid': oid } if conf.exists('v3 view {0} oid {1} exclude'.format(view, oid)): - oid_cfg['exclude'] = [] - for exclude in conf.return_values('v3 view {0} oid {1} exclude'.format(view, oid)): - oid_cfg['exclude'].append(exclude) + oid_cfg['exclude'] = conf.return_values('v3 view {0} oid {1} exclude'.format(view, oid)) view_cfg['oids'].append(oid_cfg) snmp['v3_views'].append(view_cfg) -- cgit v1.2.3