Browse Source

Fix ansible_syntax check

Russell Teague 7 năm trước cách đây
mục cha
commit
2907ea9e47
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      setup.py

+ 1 - 1
setup.py

@@ -58,7 +58,7 @@ def find_entrypoint_playbooks():
             os.path.join(os.getcwd(), 'playbooks'),
             os.path.join(os.getcwd(), 'playbooks'),
             exclude_dirs, None, r'\.ya?ml$'):
             exclude_dirs, None, r'\.ya?ml$'):
         with open(yaml_file, 'r') as contents:
         with open(yaml_file, 'r') as contents:
-            for task in yaml.safe_load(contents):
+            for task in yaml.safe_load(contents) or {}:
                 if not isinstance(task, dict):
                 if not isinstance(task, dict):
                     # Skip yaml files which are not a dictionary of tasks
                     # Skip yaml files which are not a dictionary of tasks
                     continue
                     continue