Browse Source

Fix Pacemaker collectd plugin

Error may happen:
  AttributeError: 'NoneType' object has no attribute 'iter'

Change-Id: I58ead0b0a6e9c84df853b7c9c343b661723e99d8
Swann Croiset 2 years ago
parent
commit
37459d65c9

+ 6
- 1
deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_pacemaker.py View File

@@ -246,7 +246,12 @@ class CrmMonitorPlugin(base.Base):
246 246
         # value because crm_mon doesn't provide the exact number. To estimate
247 247
         # the number of operations applied to a resource, the plugin keeps a
248 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 255
             hostname = shorten_hostname(node.get('name'))
251 256
             if hostname not in self.history:
252 257
                 self.history[hostname] = {}

Loading…
Cancel
Save