diff options
| author | Zuul <zuul@review.opendev.org> | 2021-01-25 22:17:49 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2021-01-25 22:17:49 +0000 |
| commit | 2f86b8b7ff6e7110b5b7e138a70bb706cbfe3678 (patch) | |
| tree | d551681cfa2f2b7619c0c901060d9ec7116ebdff /kolla/image | |
| parent | e11fff970f0bff6e72ab4a4ffaafc92dbf77b38f (diff) | |
| parent | a69f38198a0eff7576afff672f5496c27e520092 (diff) | |
| download | kolla-2f86b8b7ff6e7110b5b7e138a70bb706cbfe3678.tar.gz kolla-2f86b8b7ff6e7110b5b7e138a70bb706cbfe3678.zip | |
Merge "implement "allowed to fail" images"
Diffstat (limited to 'kolla/image')
| -rwxr-xr-x | kolla/image/build.py | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py index 62db92ebf..d5b058419 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -759,6 +759,7 @@ class KollaWorker(object): self.image_statuses_unmatched = dict() self.image_statuses_skipped = dict() self.image_statuses_unbuildable = dict() + self.image_statuses_allowed_to_fail = dict() self.maintainer = conf.maintainer self.distro_python_version = conf.distro_python_version @@ -1153,12 +1154,19 @@ class KollaWorker(object): 'name': name, }) - if self.image_statuses_bad: + if self.image_statuses_bad or self.image_statuses_allowed_to_fail: LOG.info("===========================") LOG.info("Images that failed to build") LOG.info("===========================") - for name, status in sorted(self.image_statuses_bad.items()): - LOG.error('%s Failed with status: %s', name, status.value) + all_bad_statuses = self.image_statuses_bad.copy() + all_bad_statuses.update(self.image_statuses_allowed_to_fail) + for name, status in sorted(all_bad_statuses.items()): + if name in self.image_statuses_allowed_to_fail: + LOG.error('%s Failed with status: %s (allowed to fail)', + name, status.value) + else: + LOG.error('%s Failed with status: %s', name, status.value) + results['failed'].append({ 'name': name, 'status': status.value, @@ -1211,12 +1219,14 @@ class KollaWorker(object): self.image_statuses_good, self.image_statuses_unmatched, self.image_statuses_skipped, - self.image_statuses_unbuildable]): + self.image_statuses_unbuildable, + self.image_statuses_allowed_to_fail]): return (self.image_statuses_bad, self.image_statuses_good, self.image_statuses_unmatched, self.image_statuses_skipped, - self.image_statuses_unbuildable) + self.image_statuses_unbuildable, + self.image_statuses_allowed_to_fail) for image in self.images: if image.status == Status.BUILT: self.image_statuses_good[image.name] = image.status @@ -1227,12 +1237,17 @@ class KollaWorker(object): elif image.status == Status.UNBUILDABLE: self.image_statuses_unbuildable[image.name] = image.status else: - self.image_statuses_bad[image.name] = image.status + if image.name in self.conf.allowed_to_fail: + self.image_statuses_allowed_to_fail[ + image.name] = image.status + else: + self.image_statuses_bad[image.name] = image.status return (self.image_statuses_bad, self.image_statuses_good, self.image_statuses_unmatched, self.image_statuses_skipped, - self.image_statuses_unbuildable) + self.image_statuses_unbuildable, + self.image_statuses_allowed_to_fail) def build_image_list(self): def process_source_installation(image, section): @@ -1403,8 +1418,9 @@ class KollaWorker(object): def run_build(): """Build container images. - :return: A 4-tuple containing bad, good, unmatched and skipped container - image status dicts, or None if no images were built. + :return: A 6-tuple containing bad, good, unmatched, skipped, + unbuildable and allowed to fail container image status dicts, + or None if no images were built. """ conf = cfg.ConfigOpts() common_config.parse(conf, sys.argv[1:], prog='kolla-build') |
