Always use lookasides for repoclosure

There's no point in checking for a layered release first. If there are
no repos, the loop will simply not execute even once. If there are
lookasides configured, we want to use them no matter if the release is
layered or not.

Also the log is updated to include the actual command for easier
debugging next time.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-07-11 10:12:39 +02:00
parent a509064696
commit 2c6b784f70
1 changed files with 10 additions and 5 deletions

View File

@ -60,9 +60,8 @@ def run_repoclosure(compose):
repo_dir = compose.paths.compose.repository(arch=arch, variant=variant)
repos[repo_id] = repo_dir
if compose.conf["release_is_layered"]:
for i, lookaside_url in enumerate(get_lookaside_repos(compose, arch, variant)):
lookaside["lookaside-%s.%s-%s" % (variant.uid, arch, i)] = lookaside_url
for i, lookaside_url in enumerate(get_lookaside_repos(compose, arch, variant)):
lookaside["lookaside-%s.%s-%s" % (variant.uid, arch, i)] = lookaside_url
cmd = repoclosure.get_repoclosure_cmd(backend=compose.conf['repoclosure_backend'],
repos=repos, lookaside=lookaside, arch=arches)
@ -74,8 +73,14 @@ def run_repoclosure(compose):
# cause any error to be printed directly to stderr.
# https://github.com/release-engineering/kobo/pull/26
try:
run(cmd, logfile=compose.paths.log.log_file(arch, "repoclosure-%s" % variant),
workdir=tmp_dir)
run(
cmd,
logfile=compose.paths.log.log_file(
arch, "repoclosure-%s" % variant
),
workdir=tmp_dir,
show_cmd=True,
)
except RuntimeError as exc:
if conf and conf[-1] == 'fatal':
raise