Skip to content
Snippets Groups Projects
Commit 7fafe584 authored by Taya Snijder's avatar Taya Snijder
Browse files

Merge branch 'L2SS-446-Extend-SNMP-client-to-support-MIB-files' of...

Merge branch 'L2SS-446-Extend-SNMP-client-to-support-MIB-files' of https://git.astron.nl/lofar2.0/tango into L2SS-446-Extend-SNMP-client-to-support-MIB-files
parents 5743e076 5400f1ed
No related branches found
No related tags found
1 merge request!288Resolve L2SS-446 "Extend snmp client to support mib files"
......@@ -54,18 +54,16 @@ class SNMP_client(CommClient):
def _process_annotation(self, annotation):
# check if the 'mib' and 'name' keys are present
if 'mib' in annotation and 'name' in annotation:
try:
mib = annotation["mib"]
name = annotation["name"]
# SNMP has tables that require an index number to access them. regular non-table variable have an index of 0
idx = annotation.get('index', 0)
else:
raise ValueError(f"SNMP attribute annotation requires a dict argument with both a 'name' and 'mib' key. Instead got: {annotation}")
return mib, name, idx
return mib, name, idx
except KeyError:
raise ValueError(f"SNMP attribute annotation requires a dict argument with both a 'name' and 'mib' key. Instead got: {annotation}")
def setup_value_conversion(self, attribute):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment