From ee2ba48aa4d32e12a18e2722492e99fca5dd03e5 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 6 Mar 2015 11:27:54 -0600 Subject: [PATCH] Fix catalog list when region name is absent Some service catalogs in the wild have services without region names defined. Let's be nice and stuff in a default value indicating this state. Closes-Bug: #1429211 Change-Id: I3ebe2534dc6e3438aaeddc7757fb2db4117eae4b --- openstackclient/identity/v2_0/catalog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstackclient/identity/v2_0/catalog.py b/openstackclient/identity/v2_0/catalog.py index 363d5ab2c0..7d17fbf586 100644 --- a/openstackclient/identity/v2_0/catalog.py +++ b/openstackclient/identity/v2_0/catalog.py @@ -28,7 +28,8 @@ def _format_endpoints(eps=None): return "" ret = '' for index, ep in enumerate(eps): - ret += eps[index]['region'] + '\n' + region = eps[index].get('region', '') + ret += region + '\n' for url in ['publicURL', 'internalURL', 'adminURL']: ret += " %s: %s\n" % (url, eps[index]['publicURL']) return ret