summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2018-09-05 10:18:18 -0700
committerJames E. Blair <jeblair@redhat.com>2018-09-05 10:18:18 -0700
commit8f1cecfd74e775f53dc3b2259f97cfdd886786f5 (patch)
treef1f503006b0a94bbe3b5233236dc0566dec3ee65
parent6106a9051f393b6140fb60e452cf384cb96616fa (diff)
Ignore non-directory entries in roles/0.2.5
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
Notes
Notes (review): Code-Review+1: Andreas Jaeger <jaegerandi@gmail.com> Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Monty Taylor <mordred@inaugust.com> Workflow+1: Monty Taylor <mordred@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 05 Sep 2018 19:28:27 +0000 Reviewed-on: https://review.openstack.org/600135 Project: openstack-infra/zuul-sphinx Branch: refs/heads/master
-rw-r--r--tests/roles/__init__.py3
-rw-r--r--zuul_sphinx/zuul.py2
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/roles/__init__.py b/tests/roles/__init__.py
new file mode 100644
index 0000000..603655d
--- /dev/null
+++ b/tests/roles/__init__.py
@@ -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.
diff --git a/zuul_sphinx/zuul.py b/zuul_sphinx/zuul.py
index 114f0d3..7fb3800 100644
--- a/zuul_sphinx/zuul.py
+++ b/zuul_sphinx/zuul.py
@@ -180,6 +180,8 @@ class ZuulDirective(Directive):
180 roles = env.domaindata['zuul']['role_paths'] 180 roles = env.domaindata['zuul']['role_paths']
181 for d in role_dirs: 181 for d in role_dirs:
182 for p in os.listdir(d): 182 for p in os.listdir(d):
183 if not os.path.isdir(os.path.join(d, p)):
184 continue
183 role_readme = os.path.join(d, p, 'README.rst') 185 role_readme = os.path.join(d, p, 'README.rst')
184 if os.path.exists(role_readme): 186 if os.path.exists(role_readme):
185 roles[p] = role_readme 187 roles[p] = role_readme