Browse Source

Ignore non-directory entries in roles/

The check for whether a README.rst exists would naively look for
files like __init__.py/README.rst if there were files in the roles/
directory.  Only look for role directories instead.

Change-Id: I80268047a08b1294ccef841cd59894ec7133d16d
James E. Blair 7 months ago
parent
commit
8f1cecfd74
2 changed files with 5 additions and 0 deletions
  1. 3
    0
      tests/roles/__init__.py
  2. 2
    0
      zuul_sphinx/zuul.py

+ 3
- 0
tests/roles/__init__.py View File

@@ -0,0 +1,3 @@
1
+# Stestr discovery in zuul-jobs requires a fully importable filesystem
2
+# hierarchy, so simulate that by including a __init__.py file in the
3
+# roles dir.

+ 2
- 0
zuul_sphinx/zuul.py View File

@@ -180,6 +180,8 @@ class ZuulDirective(Directive):
180 180
         roles = env.domaindata['zuul']['role_paths']
181 181
         for d in role_dirs:
182 182
             for p in os.listdir(d):
183
+                if not os.path.isdir(os.path.join(d, p)):
184
+                    continue
183 185
                 role_readme = os.path.join(d, p, 'README.rst')
184 186
                 if os.path.exists(role_readme):
185 187
                     roles[p] = role_readme

Loading…
Cancel
Save