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
This commit is contained in:
Dean Troyer 2015-03-06 11:27:54 -06:00
parent d05b5e14f1
commit ee2ba48aa4
1 changed files with 2 additions and 1 deletions

View File

@ -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', '<none>')
ret += region + '\n'
for url in ['publicURL', 'internalURL', 'adminURL']:
ret += " %s: %s\n" % (url, eps[index]['publicURL'])
return ret