Skip to content
Snippets Groups Projects
Commit 5400f1ed authored by Auke Klazema's avatar Auke Klazema Committed by Taya Snijder
Browse files

changed setu_annotation

parent 6eeda113
No related branches found
No related tags found
1 merge request!288Resolve L2SS-446 "Extend snmp client to support mib files"
......@@ -60,18 +60,16 @@ class SNMP_client(CommClient):
index (optional) the index if the value thats being read from is a table.
"""
# 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
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