Ignore __pycache__ directory when looking at roles

For some reason, locally "tox -e docs" on zuul-jobs creates a
roles/__pycache__ directory; I think because it has a __init__.py
because we need that to correctly find unit-tests
(I9a653666e8a083fb7f3fbb92589fe0467a41e6e6).  I can not seem to
convince it to not write this directory.

Ignore __pycache__ directories when matching.

Change-Id: If7e70456a31554317c419fcb2ad3aad1ad19c6bf
This commit is contained in:
Ian Wienand 2020-03-30 15:10:03 +11:00
parent 6a29830441
commit e32f4e11f0

View File

@ -188,6 +188,8 @@ class ZuulDirective(Directive):
for p in os.listdir(d):
if not os.path.isdir(os.path.join(d, p)):
continue
if p in ('__pycache__',):
continue
role_readme = os.path.join(d, p, 'README.rst')
if os.path.exists(role_readme):
roles[p] = role_readme