From 5196790cfdd606845f0a8c2b02c4989e8cdbd151 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 4 Aug 2017 10:28:44 -0400 Subject: [PATCH] handle errors formatting review data output Add an exception handler to catch formatting errors, just in case. Change-Id: Ia457f5ab8dafedf24366fb2e073bd174ef40d60f Signed-off-by: Doug Hellmann --- openstack_releases/cmds/list_changes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openstack_releases/cmds/list_changes.py b/openstack_releases/cmds/list_changes.py index d969d8a021..5be2fb16c8 100644 --- a/openstack_releases/cmds/list_changes.py +++ b/openstack_releases/cmds/list_changes.py @@ -136,7 +136,11 @@ def list_gerrit_patches(title, template, query): for r in reviews: if 'topic' not in r: r['topic'] = '' - print(template.format(**r)) + try: + print(template.format(**r)) + except Exception as err: + print('Could not format review data: {}'.format(err)) + print(r) print('{} results\n'.format(len(reviews)))