diff options
author | Andrea Bolognani <abologna@redhat.com> | 2022-05-31 11:31:49 +0200 |
---|---|---|
committer | Andrea Bolognani <abologna@redhat.com> | 2022-05-31 11:53:20 +0200 |
commit | 6db8a29f13b4e8f105989912b306346c9738e51a (patch) | |
tree | d2d1642705932d4227b5ef8c66f7a66e5479ede1 | |
parent | e7290fa200b8362c9492af66679fee6cd7dcc039 (diff) | |
download | libvirt-ci-6db8a29f13b4e8f105989912b306346c9738e51a.zip libvirt-ci-6db8a29f13b4e8f105989912b306346c9738e51a.tar.gz libvirt-ci-6db8a29f13b4e8f105989912b306346c9738e51a.tar.bz2 |
lcitool: Handle include list correctly
Do for all other included files what we've just done for
sanity-checks.yml, and only add them to the list of includes if
they are going to be generated.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
-rw-r--r-- | guests/lcitool/lcitool/manifest.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/guests/lcitool/lcitool/manifest.py b/guests/lcitool/lcitool/manifest.py index f126540..4d1892d 100644 --- a/guests/lcitool/lcitool/manifest.py +++ b/guests/lcitool/lcitool/manifest.py @@ -280,7 +280,8 @@ class Manifest: path = Path(gitlabdir, "container-templates.yml") content = [gitlab.container_template(namespace, project, self.cidir)] self._replace_file(content, path, dryrun) - includes.append(path) + if len(content) > 0: + includes.append(path) if gitlabinfo["builds"]: path = Path(gitlabdir, "build-templates.yml") @@ -292,7 +293,8 @@ class Manifest: if gitlabinfo["cirrus"]: content.append(gitlab.cirrus_template(self.cidir)) self._replace_file(content, path, dryrun) - includes.append(path) + if len(content) > 0: + includes.append(path) testcontent = [] if jobinfo["check-dco"]: @@ -315,7 +317,8 @@ class Manifest: content.extend(self._generate_gitlab_native_container_jobs()) content.extend(self._generate_gitlab_cross_container_jobs()) self._replace_file(content, path, dryrun) - includes.append(path) + if len(content) > 0: + includes.append(path) if gitlabinfo["builds"]: path = Path(gitlabdir, "builds.yml") @@ -324,7 +327,8 @@ class Manifest: content.extend(self._generate_gitlab_cross_build_jobs()) content.extend(self._generate_gitlab_cirrus_build_jobs()) self._replace_file(content, path, dryrun) - includes.append(path) + if len(content) > 0: + includes.append(path) path = Path(self.cidir, "gitlab.yml") content = [gitlab.includes(includes)] |