aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-03-27 09:15:02 +0000
committerGerrit Code Review <review@openstack.org>2019-03-27 09:15:02 +0000
commit6c1a0f22aa4ccb5b2bb729d620365685e5ee3ca9 (patch)
treef4ebc1e60da057471268ebde4ae92b124ba4455d
parent429db41358cada5e03cd7a764bbd787d049b2b7e (diff)
parenta21ab86ca6e38a9b90a6c40f2aab87030e6f010f (diff)
downloadkolla-6c1a0f22aa4ccb5b2bb729d620365685e5ee3ca9.tar.gz
kolla-6c1a0f22aa4ccb5b2bb729d620365685e5ee3ca9.zip
Merge "build: handle template syntax errors better"
-rwxr-xr-xkolla/cmd/build.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index 25facd19d..e912a6d12 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import jinja2
import os
import sys
@@ -28,13 +29,18 @@ from kolla.image import build # noqa
def main():
- statuses = build.run_build()
- if statuses:
- (bad_results, good_results, unmatched_results,
- skipped_results) = statuses
- if bad_results:
- return 1
- return 0
+ try:
+ statuses = build.run_build()
+ if statuses:
+ (bad_results, good_results, unmatched_results,
+ skipped_results) = statuses
+ if bad_results:
+ return 1
+ return 0
+ except jinja2.exceptions.TemplateSyntaxError as e:
+ build.LOG.error("Syntax error in template: %s" % e.name)
+ build.LOG.error(e.message)
+ return 1
if __name__ == '__main__':