From 053e7c8a731b7bb836e92efc73e8784ac125d5e5 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 10 Jul 2017 14:27:29 -0700 Subject: [PATCH] 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 --- zuul/executor/server.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zuul/executor/server.py b/zuul/executor/server.py index 1ebe55d946..d90ba9239e 100644 --- a/zuul/executor/server.py +++ b/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,))