Module: check_mk
Branch: master
Commit: f7d60b20180a7011a81500626cffece3efd4ddd0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7d60b20180a70…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Mar 3 13:31:41 2017 +0100
4480 FIX cisco_redundancy: fixed UnboundLocalError: local variable 'infotext'
referenced before assignment
Change-Id: I7eb2844a1e5f0fe0511ed2803463cf525c19439d
---
.werks/4480 | 11 +++++++++++
checks/cisco_redundancy | 3 ++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/4480 b/.werks/4480
new file mode 100644
index 0000000..955d68f
--- /dev/null
+++ b/.werks/4480
@@ -0,0 +1,11 @@
+Title: cisco_redundancy: fixed UnboundLocalError: local variable 'infotext'
referenced before assignment
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1488544232
+
+
diff --git a/checks/cisco_redundancy b/checks/cisco_redundancy
index d9cccac..c72ce13 100644
--- a/checks/cisco_redundancy
+++ b/checks/cisco_redundancy
@@ -72,6 +72,7 @@ def check_cisco_redundancy(_no_item, params, info):
"7" : "active unit removed",
},
}
+
infotexts = {}
for what, states in [("now", info[0][:5]), ("init",
params["init_states"])]:
unit_id, unit_state, peer_id, peer_state, duplex_mode = states
@@ -93,7 +94,7 @@ def check_cisco_redundancy(_no_item, params, info):
state = 2
infotext = "Switchover - Old status: %s, New status: %s" % \
- (infotext["init"], infotext["now"])
+ (infotexts["init"], infotexts["now"])
if peer_state == "1":
state = 2