Browse Source

Merge "Raise an error if a file in zuul.d is empty"

Zuul 3 weeks ago
parent
commit
3cae816ab4
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      zuul_sphinx/zuul.py

+ 5
- 1
zuul_sphinx/zuul.py View File

@@ -104,8 +104,12 @@ class ZuulDirective(Directive):
104 104
     def parse_zuul_d(self, path):
105 105
         layout = Layout()
106 106
         for conf in os.listdir(path):
107
-            with open(os.path.join(path, conf)) as f:
107
+            conf_path = os.path.join(path, conf)
108
+            with open(conf_path) as f:
108 109
                 data = yaml.load(f, Loader=ZuulSafeLoader)
110
+            if data is None:
111
+                raise SphinxError(
112
+                    "File %s in Zuul dir is empty", conf_path)
109 113
             for obj in data:
110 114
                 if 'job' in obj:
111 115
                     layout.jobs.append(obj['job'])

Loading…
Cancel
Save