diff options
| author | Zuul <zuul@review.openstack.org> | 2019-03-27 09:15:02 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-03-27 09:15:02 +0000 |
| commit | 6c1a0f22aa4ccb5b2bb729d620365685e5ee3ca9 (patch) | |
| tree | f4ebc1e60da057471268ebde4ae92b124ba4455d /kolla | |
| parent | 429db41358cada5e03cd7a764bbd787d049b2b7e (diff) | |
| parent | a21ab86ca6e38a9b90a6c40f2aab87030e6f010f (diff) | |
| download | kolla-6c1a0f22aa4ccb5b2bb729d620365685e5ee3ca9.tar.gz kolla-6c1a0f22aa4ccb5b2bb729d620365685e5ee3ca9.zip | |
Merge "build: handle template syntax errors better"
Diffstat (limited to 'kolla')
| -rwxr-xr-x | kolla/cmd/build.py | 20 |
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__': |
