aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-09 20:03:16 +0000
committerGerrit Code Review <review@openstack.org>2016-12-09 20:03:17 +0000
commit3892d60ff372b30fae7d7d078161d1ae99c65157 (patch)
tree7780a9d414eb1e98ddb815615f332d33332467b3
parent21693427cdbc62eb5d507c68190376cd23e18260 (diff)
parent5913f04672672725bfb9a56499ad25e4e7c441c4 (diff)
downloadkolla-3892d60ff372b30fae7d7d078161d1ae99c65157.tar.gz
kolla-3892d60ff372b30fae7d7d078161d1ae99c65157.zip
Merge "Add ability to output the things built/failed/not build"
-rw-r--r--kolla/common/config.py3
-rwxr-xr-xkolla/image/build.py22
2 files changed, 23 insertions, 2 deletions
diff --git a/kolla/common/config.py b/kolla/common/config.py
index 1a65d464e..89efa7eaa 100644
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -111,6 +111,9 @@ _CLI_OPTS = [
cfg.StrOpt('save-dependency',
help=('Path to the file to store the docker image'
' dependency in Graphviz dot format')),
+ cfg.StrOpt('format', short='f', default='json',
+ choices=['json', 'none'],
+ help=('Format to write the final results in')),
cfg.StrOpt('type', short='t', default='binary',
choices=INSTALL_TYPE_CHOICES,
dest='install_type',
diff --git a/kolla/image/build.py b/kolla/image/build.py
index 3816fc8e4..fde63e6a0 100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -739,6 +739,11 @@ class KollaWorker(object):
LOG.debug("Image %s failed", image.name)
self.get_image_statuses()
+ results = {
+ 'built': [],
+ 'failed': [],
+ 'not_matched': [],
+ }
if self.image_statuses_good:
LOG.info("=========================")
@@ -746,6 +751,9 @@ class KollaWorker(object):
LOG.info("=========================")
for name in self.image_statuses_good.keys():
LOG.info(name)
+ results['built'].append({
+ 'name': name,
+ })
if self.image_statuses_bad:
LOG.info("===========================")
@@ -753,6 +761,10 @@ class KollaWorker(object):
LOG.info("===========================")
for name, status in self.image_statuses_bad.items():
LOG.error('%s Failed with status: %s', name, status)
+ results['failed'].append({
+ 'name': name,
+ 'status': status,
+ })
if self.image_statuses_unmatched:
LOG.debug("=====================================")
@@ -760,6 +772,11 @@ class KollaWorker(object):
LOG.debug("=====================================")
for name in self.image_statuses_unmatched.keys():
LOG.debug(name)
+ results['not_matched'].append({
+ 'name': name,
+ })
+
+ return results
def get_image_statuses(self):
if any([self.image_statuses_bad,
@@ -997,7 +1014,8 @@ def run_build():
queue.put(WorkerThread.tombstone)
raise
- kolla.summary()
+ results = kolla.summary()
kolla.cleanup()
-
+ if conf.format == 'json':
+ print(json.dumps(results))
return kolla.get_image_statuses()