summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwann Croiset <scroiset@mirantis.com>2017-01-20 17:33:37 +0100
committerSwann Croiset <scroiset@mirantis.com>2017-01-23 10:19:58 +0100
commit37459d65c97ec6cf4adc4a835c495410561b2c98 (patch)
tree8263bffc1d129f7819b440f7be95961083e6afae
parent973c62b04b95bce31fa441bd77477940eb134466 (diff)
Fix Pacemaker collectd plugin
Error may happen: AttributeError: 'NoneType' object has no attribute 'iter' Change-Id: I58ead0b0a6e9c84df853b7c9c343b661723e99d8
Notes
Notes (review): Code-Review+2: Simon Pasquier <spasquier@mirantis.com> Workflow+1: Swann Croiset <scroiset@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 23 Jan 2017 09:22:38 +0000 Reviewed-on: https://review.openstack.org/423362 Project: openstack/fuel-plugin-lma-collector Branch: refs/heads/master
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_pacemaker.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_pacemaker.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_pacemaker.py
index 37f793a..e8cb7b2 100644
--- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_pacemaker.py
+++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_pacemaker.py
@@ -246,7 +246,12 @@ class CrmMonitorPlugin(base.Base):
246 # value because crm_mon doesn't provide the exact number. To estimate 246 # value because crm_mon doesn't provide the exact number. To estimate
247 # the number of operations applied to a resource, the plugin keeps a 247 # the number of operations applied to a resource, the plugin keeps a
248 # copy of call_ids and compares it with the current value. 248 # copy of call_ids and compares it with the current value.
249 for node in root.find('node_history').iter('node'): 249
250 history = root.find('node_history')
251 if history is None:
252 return
253
254 for node in history.iter('node'):
250 hostname = shorten_hostname(node.get('name')) 255 hostname = shorten_hostname(node.get('name'))
251 if hostname not in self.history: 256 if hostname not in self.history:
252 self.history[hostname] = {} 257 self.history[hostname] = {}