Skip to content

Commit ee932bd

Browse files
rpmbuild: improve the project list management
This change removes a None value from the args.project lists. Change-Id: I14200359ded5a959b4732828d89e41a0d6d12a36
1 parent 9b323e9 commit ee932bd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

zuul_koji_lib.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,8 @@ def get_buildset_url(project, ref):
274274
"local/builds?"
275275
"project=" + project + "&"
276276
"change=" + ref)
277-
build = r.json()[0]
277+
try:
278+
build = r.json()[0]
279+
except IndexError:
280+
return None
278281
return build["log_url"] + "buildset/"

zuul_rpm_build.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def usage(self):
3737
default=os.environ.get('ZUUL_BRANCH', 'master'))
3838
p.add_argument("--pipeline",
3939
default=os.environ.get('ZUUL_PIPELINE', 'check'))
40-
p.add_argument("--project", action='append',
41-
default=[os.environ.get('ZUUL_PROJECT')],
40+
p.add_argument("--project", action='append', default=[],
4241
help="Specify project name when running outside"
4342
" of Zuul context"),
4443
p.add_argument("--source",
@@ -323,6 +322,9 @@ def main(self, args):
323322
"%s %s", project, ref)
324323
# Special case for zuul ui to re-use the src.rpm:
325324
buildset_url = zuul_koji_lib.get_buildset_url(project, ref)
325+
if buildset_url is None:
326+
self.log.warning("Buildset is missing")
327+
continue
326328
self.log.info("Using this buildset", buildset_url)
327329
srpms = zuul_koji_lib.get_srpms(buildset_url)
328330
self.log.info("And this srpm %s", str(srpms))

0 commit comments

Comments
 (0)