Fix Pacemaker collectd plugin
Error may happen: AttributeError: 'NoneType' object has no attribute 'iter' Change-Id: I58ead0b0a6e9c84df853b7c9c343b661723e99d8
This commit is contained in:
parent
973c62b04b
commit
37459d65c9
|
@ -246,7 +246,12 @@ class CrmMonitorPlugin(base.Base):
|
||||||
# value because crm_mon doesn't provide the exact number. To estimate
|
# value because crm_mon doesn't provide the exact number. To estimate
|
||||||
# the number of operations applied to a resource, the plugin keeps a
|
# the number of operations applied to a resource, the plugin keeps a
|
||||||
# copy of call_ids and compares it with the current value.
|
# copy of call_ids and compares it with the current value.
|
||||||
for node in root.find('node_history').iter('node'):
|
|
||||||
|
history = root.find('node_history')
|
||||||
|
if history is None:
|
||||||
|
return
|
||||||
|
|
||||||
|
for node in history.iter('node'):
|
||||||
hostname = shorten_hostname(node.get('name'))
|
hostname = shorten_hostname(node.get('name'))
|
||||||
if hostname not in self.history:
|
if hostname not in self.history:
|
||||||
self.history[hostname] = {}
|
self.history[hostname] = {}
|
||||||
|
|
Loading…
Reference in New Issue