From 1950c5ea3a3e8e5b85edee3cc97f31202c93544c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 3 May 2022 17:41:22 -0400 Subject: [PATCH] qemuvariants: Extract ostree repo in mutate image, not class init A whole big twisted chain here; `cosa buildextend-aws` was crashing in the FCOS promote job I think becuase it allocates a separate tempdir. The data we need (ostree commit) is in the `build_dir`. So we could likely just tweak that, but while we're here, move the import into the "prepare" phase and not the class init so it's more "on demand". --- src/cosalib/qemuvariants.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cosalib/qemuvariants.py b/src/cosalib/qemuvariants.py index b546c8bdd5..ffd92417a9 100644 --- a/src/cosalib/qemuvariants.py +++ b/src/cosalib/qemuvariants.py @@ -183,9 +183,6 @@ def __init__(self, **kwargs): _Build.__init__(self, **kwargs) - repo = os.path.join(self._workdir, 'tmp/repo') - import_ostree_commit(repo, self._tmpdir, self.meta) - @property def image_qemu(self): """ @@ -234,6 +231,10 @@ def mutate_image(self): :param callback: callback function for extra processing image :type callback: function """ + + repo = os.path.join(self._workdir, 'tmp/repo') + import_ostree_commit(repo, self.build_dir, self.meta) + work_img = os.path.join(self._tmpdir, f"{self.image_name_base}.{self.image_format}") final_img = os.path.join(os.path.abspath(self.build_dir),