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

added test for namedValue

parent 5ecfcbe5
Branches
Tags
1 merge request!288Resolve L2SS-446 "Extend snmp client to support mib files"
...@@ -13,6 +13,7 @@ __all__ = ["SNMP_client"] ...@@ -13,6 +13,7 @@ __all__ = ["SNMP_client"]
snmp_to_numpy_dict = { snmp_to_numpy_dict = {
hlapi.Integer32: numpy.int64, hlapi.Integer32: numpy.int64,
hlapi.Integer: numpy.int64,
hlapi.TimeTicks: numpy.int64, hlapi.TimeTicks: numpy.int64,
hlapi.OctetString: str, hlapi.OctetString: str,
hlapi.ObjectIdentity: str, hlapi.ObjectIdentity: str,
...@@ -218,7 +219,7 @@ class snmp_attribute: ...@@ -218,7 +219,7 @@ class snmp_attribute:
# IpAddress values get printed as their raw value but in hex (7F 20 20 01 for 127.0.0.1 for example) # IpAddress values get printed as their raw value but in hex (7F 20 20 01 for 127.0.0.1 for example)
vals.append(varBind[1].prettyPrint()) vals.append(varBind[1].prettyPrint())
elif snmp_type is hlapi.Integer32 and self.dtype == str: elif snmp_type is hlapi.Integer32 or snmp_type is hlapi.Integer and self.dtype == str:
# Integers can have 'named values', Where a value can be translated to a specific name. A dict basically # Integers can have 'named values', Where a value can be translated to a specific name. A dict basically
# Example: {1: "other", 2: "invalid", 3: "dynamic", 4: "static",} # Example: {1: "other", 2: "invalid", 3: "dynamic", 4: "static",}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment