snmp: Fix discovery when total memory is missing
In 7348c156a8
, we fix some case
where the oid value was not existed.
The post operation for "memory_avail" does not use the generic function
for getting oid value and is impacted by already fixed bug.
This change uses get_oid_value for "memory_avail" like any other place
to fix the issue.
Change-Id: I4b944716af301534a0906dd0ea6117c18c913d50
Closes-bug: #1707859
This commit is contained in:
parent
5a08978e61
commit
61fec88d4e
@ -274,8 +274,12 @@ class SNMPInspector(base.Inspector):
|
||||
_memory_total_oid = "1.3.6.1.4.1.2021.4.5.0"
|
||||
if _memory_total_oid not in cache[self._CACHE_KEY_OID]:
|
||||
self._query_oids(host, [_memory_total_oid], cache, False)
|
||||
value = int(cache[self._CACHE_KEY_OID][_memory_total_oid]) - value
|
||||
return value
|
||||
|
||||
total_value = self.get_oid_value(cache[self._CACHE_KEY_OID],
|
||||
(_memory_total_oid, int))
|
||||
if total_value is None:
|
||||
return None
|
||||
return total_value - value
|
||||
|
||||
def _post_op_net(self, host, cache, meter_def,
|
||||
value, metadata, extra, suffix):
|
||||
|
Loading…
Reference in New Issue
Block a user