Fail execution if a role repo is a bare collection of roles

We generally expect a repo to either be a single bare role, or
to have a "roles/" directory which is a collection of roles.

We previously also supported the repo itself being a collection
of roles at the root of the repo, but that's not widely used
and is potentially confusing.  Especially since we want to make
a followup change to implicitly treat some repos as roles repos.

Stop supporting that for now.  If folks want to support this,
we might consider doing so only if there is a meta/main.ya?ml
file in the repo (as Galaxy accidentally supports that, though
it is not an explicit contract they guarantee).

Change-Id: Ie70e9fae4da57d4aefa01442a9f60526163b27c0
changes/27/482327/1
James E. Blair 5 years ago
parent 6b537764f3
commit 053e7c8a73
  1. 7
      zuul/executor/server.py

@ -1079,11 +1079,8 @@ class AnsibleJob(object):
for entry in os.listdir(d):
self._blockPluginDirs(os.path.join(d, entry))
return d
# We assume the repository itself is a collection of roles
if not trusted:
for entry in os.listdir(path):
self._blockPluginDirs(os.path.join(path, entry))
return path
# It is neither a bare role, nor a collection of roles
raise Exception("Unable to find role in %s" % (path,))
def prepareZuulRole(self, args, role, root, trusted, untrusted):
self.log.debug("Prepare zuul role for %s" % (role,))

Loading…
Cancel
Save