Allow all zuul args to be set in zuul-cloner

Previously zuul-cloner required that no zuul-args be set. The intent was
that all args be set or none be set and to disallow any partial setting
of the zuul args. Add the condition to allow all zuul args to be set by
allowing the length of the missing zuul args list to be 0.

Change-Id: I944f12aa1148bce7d3998b400e8d6e86fd0164d5
This commit is contained in:
Clark Boylan 2015-05-15 10:01:56 -07:00
parent 5a412bfc49
commit fd463c84bf
1 changed files with 2 additions and 1 deletions

View File

@ -93,7 +93,8 @@ class Cloner(zuul.cmd.ZuulApp):
# must all be set, otherwise fallback to defaults.
zuul_missing = [zuul_opt for zuul_opt, val in vars(args).items()
if zuul_opt.startswith('zuul') and val is None]
if len(zuul_missing) < len(ZUUL_ENV_SUFFIXES):
if (len(zuul_missing) > 0 and
len(zuul_missing) < len(ZUUL_ENV_SUFFIXES)):
parser.error(("Some Zuul parameters are not set:\n\t%s\n"
"Define them either via environment variables or "
"using options above." %