소스 검색

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