aboutsummaryrefslogtreecommitdiff
path: root/kolla
diff options
context:
space:
mode:
authorWill Miller <wmiller@cray.com>2016-05-25 04:04:52 -0500
committerWill Miller <wmiller@cray.com>2016-05-27 06:39:52 -0500
commit18ae114e7557ecc0a5692ea3a22b418df7bba52f (patch)
treeaee5b9ae6f1964d8502428a80ab8c9c12f1fb0dc /kolla
parentc51e315523fe37f28dc9b0968191b7e07125c24b (diff)
downloadkolla-18ae114e7557ecc0a5692ea3a22b418df7bba52f.tar.gz
kolla-18ae114e7557ecc0a5692ea3a22b418df7bba52f.zip
Fix kolla-build return codes
Add a main wrapper function to return 1 if any images failed to build; otherwise, return 0. Rename the old main() to run_build(), which still returns image statuses, to avoid interfering with unit tests. Change-Id: I5817cc9cebb4f42dc13e0535223e5dc8931a3aab Co-Authored-By: Mark Goddard <mgoddard@cray.com> Closes-Bug: #1578404
Diffstat (limited to 'kolla')
-rwxr-xr-xkolla/cmd/build.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index bbd9788ad..18ff68503 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -737,7 +737,7 @@ class KollaWorker(object):
return queue
-def main():
+def run_build():
conf = cfg.ConfigOpts()
common_config.parse(conf, sys.argv[1:], prog='kolla-build')
@@ -791,5 +791,13 @@ def main():
return kolla.get_image_statuses()
+def main():
+ bad_results, good_results, unmatched_results = run_build()
+ if len(bad_results):
+ return 1
+ else:
+ return 0
+
+
if __name__ == '__main__':
main()