snmp: Fix discovery when total memory is missing
In7348c156a8
, 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 (cherry picked from commit61fec88d4e
)
This commit is contained in:
parent
00d2f6faf2
commit
39196afd03
|
@ -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