Module: check_mk
Branch: master
Commit: f3c8a4b5bb57b679cdfc50110635894fca6be078
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f3c8a4b5bb57b6…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Tue Jan 22 12:18:20 2019 +0100
mk_jolokia: minor simplification
Change-Id: Ib6a405b63df538636c7dad46632700deb5331b7a
---
agents/plugins/mk_jolokia.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/agents/plugins/mk_jolokia.py b/agents/plugins/mk_jolokia.py
index ff068d0..38bc5d6 100755
--- a/agents/plugins/mk_jolokia.py
+++ b/agents/plugins/mk_jolokia.py
@@ -356,15 +356,14 @@ def make_item_list(path, value, itemspec):
def extract_item(key, itemspec):
+ if not itemspec:
+ return ()
+
path = key.split(":", 1)[-1]
components = path.split(",")
+ comp_dict = dict(c.split('=') for c in components if c.count('=') ==
1)
+
item = ()
- comp_dict = {}
- for comp in components:
- parts = comp.split("=")
- if len(parts) == 2:
- left, right = parts
- comp_dict[left] = right
for pathkey in itemspec:
if pathkey in comp_dict:
right = comp_dict[pathkey]