Module: check_mk
Branch: master
Commit: c81970b7dbe6c76cbb4e755dbae1bffe0442e7c0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c81970b7dbe6c7…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Jul 11 14:29:27 2018 +0200
heartbeat_crm: don't change info variable
Change-Id: Ib852ef607f05e9c096cb52d7c66ff49a238408b2
---
checks/heartbeat_crm | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/checks/heartbeat_crm b/checks/heartbeat_crm
index 552c83c..abcdacd 100644
--- a/checks/heartbeat_crm
+++ b/checks/heartbeat_crm
@@ -237,23 +237,23 @@ def heartbeat_crm_parse_resources(info):
resources[parts[2]] = []
resource = parts[2]
mode = 'masterslaveset'
- elif line[0] == '_':
- # Cleanup inconsistent agent output in clone set lines
+ elif line.startswith('_'):
+ # consider inconsistent agent output in clone set lines
+ fixed_parts = parts[1:]
if parts[0] != "_":
- parts.insert(1, parts[0][1:])
- parts[0] = "_"
+ fixed_parts.insert(0, parts[0].lstrip('_'))
# Resource group or set member
if mode == 'resourcegroup':
- resources[resource].append(parts[1:])
+ resources[resource].append(fixed_parts)
elif mode == 'cloneset':
- if parts[1] == 'Started:':
- resources[resource].append([ resource, 'Clone',
'Started', parts[3:-1] ])
+ if fixed_parts[0] == 'Started:':
+ resources[resource].append([ resource, 'Clone',
'Started', fixed_parts[2:-1] ])
elif mode == 'masterslaveset':
- if parts[1] == 'Masters:':
- resources[resource].append([ resource, 'Master',
'Started', parts[3] ])
- if parts[1] == 'Slaves:':
- resources[resource].append([ resource, 'Slave',
'Started', parts[3] ])
+ if fixed_parts[0] == 'Masters:':
+ resources[resource].append([ resource, 'Master',
'Started', fixed_parts[2] ])
+ if fixed_parts[0] == 'Slaves:':
+ resources[resource].append([ resource, 'Slave',
'Started', fixed_parts[2] ])
else:
# Single resource
resources[parts[0]] = [ parts ]