Fix createrepo issue for modular compose when multiple threads tried to use the same tmp directory.
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
parent
d4b7293acb
commit
621f1e2247
@ -30,7 +30,7 @@ from kobo.shortcuts import run, relative_path
|
||||
from ..wrappers.scm import get_dir_from_scm
|
||||
from ..wrappers.createrepo import CreaterepoWrapper
|
||||
from .base import PhaseBase
|
||||
from ..util import find_old_compose
|
||||
from ..util import find_old_compose, temp_dir
|
||||
|
||||
import productmd.rpms
|
||||
|
||||
@ -187,7 +187,7 @@ def create_variant_repo(compose, arch, variant, pkg_type):
|
||||
modules = {"modules": []}
|
||||
for mmd in variant.mmds:
|
||||
modules["modules"].append(yaml.safe_load(mmd.dumps()))
|
||||
tmp_dir = compose.mkdtemp(prefix="pungi_")
|
||||
with temp_dir() as tmp_dir:
|
||||
modules_path = os.path.join(tmp_dir, "modules.yaml")
|
||||
with open(modules_path, "w") as outfile:
|
||||
outfile.write(yaml.safe_dump(modules))
|
||||
@ -197,7 +197,6 @@ def create_variant_repo(compose, arch, variant, pkg_type):
|
||||
log_file = compose.paths.log.log_file(
|
||||
arch, "modifyrepo-modules-%s" % variant)
|
||||
run(cmd, logfile=log_file, show_cmd=True)
|
||||
shutil.rmtree(tmp_dir)
|
||||
|
||||
compose.log_info("[DONE ] %s" % msg)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user