瀏覽代碼

Update installer_checkpoint plugin to handle empty stats

If the installer_checkpoint plugin is loaded and no custom stats are
added during the playbook run, the plugin will fail.  This adds a check
to return if the custom stats are empty.
Russell Teague 6 年之前
父節點
當前提交
30843595e9
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      roles/installer_checkpoint/callback_plugins/installer_checkpoint.py

+ 4 - 0
roles/installer_checkpoint/callback_plugins/installer_checkpoint.py

@@ -19,6 +19,10 @@ class CallbackModule(CallbackBase):
 
     def v2_playbook_on_stats(self, stats):
 
+        # Return if there are no custom stats to process
+        if stats.custom == {}:
+            return
+
         phases = stats.custom['_run']
 
         # Find the longest phase title