Module: check_mk
Branch: master
Commit: b23aa23cfa5d55ff5821612bd8582bc805384fc5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b23aa23cfa5d55…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Apr 28 18:15:11 2016 +0200
mkeventd: Fixed pylint validation errors
---
bin/mkeventd | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/bin/mkeventd b/bin/mkeventd
index 2c80cdc..7b734ea 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -359,7 +359,7 @@ def initialize_snmptrap_engine():
initialize_snmp_credentials()
g_snmp_receiver = snmp_ntfrcv.NotificationReceiver(g_snmp_engine,
- lambda *args: g_event_server.handle_snmptrap(*args))
+ g_event_server.handle_snmptrap)
def initialize_snmp_credentials():
@@ -1314,12 +1314,19 @@ class EventServer:
log('Failed to translate OIDs, no modules loaded (see above)')
return [(str(oid), str(value)) for oid, value in var_bind_list]
+ def translate(oid, value):
+ # Disable mib_var[0] type detection
+ # pylint: disable=no-member
+ mib_var = ObjectType(ObjectIdentity(oid),
value).resolveWithMib(self._mib_resolver)
+ node = mib_var[0].getMibNode()
+ translated_oid = mib_var[0].prettyPrint().replace("\"",
"")
+ translated_value = mib_var[1].prettyPrint()
+
+ return node, translated_oid, translated_value
+
for oid, value in var_bind_list:
try:
- mib_var = ObjectType(ObjectIdentity(oid),
value).resolveWithMib(self._mib_resolver)
- node = mib_var[0].getMibNode()
- translated_oid = mib_var[0].prettyPrint().replace("\"",
"")
- translated_value = mib_var[1].prettyPrint()
+ node, translated_oid, translated_value = translate(oid, value)
if hasattr(node, "getUnits"):
translated_value += ' ' + node.getUnits()