Jelajahi Sumber

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 tahun lalu
induk
melakukan
30843595e9

+ 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