diff options
| author | Julien Danjou <julien@danjou.info> | 2016-05-24 15:56:27 +0200 |
|---|---|---|
| committer | Julien Danjou <julien@danjou.info> | 2016-05-25 16:13:48 +0200 |
| commit | e44bb009d36bddc0fdfb6e949ddc293de291dcca (patch) | |
| tree | 8eb8d16f5b95fdd7b117fc988679799c0bf0e794 /openstackclient/identity | |
| parent | 5ae8f1b7d52ca9c94a01aeef13754b1d5a15a91f (diff) | |
| download | python-openstackclient-e44bb009d36bddc0fdfb6e949ddc293de291dcca.tar.gz | |
keystone: fix catalog output when region is unset
If no region is set in Keystone, null is deserialized as None and the
region has None has value, which triggers a type error when building the
output string.
This patch fixes that.
Change-Id: I7637dc2595655cf452f38308f99fe66ac782e16d
Diffstat (limited to 'openstackclient/identity')
| -rw-r--r-- | openstackclient/identity/v2_0/catalog.py | 4 | ||||
| -rw-r--r-- | openstackclient/identity/v3/catalog.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/openstackclient/identity/v2_0/catalog.py b/openstackclient/identity/v2_0/catalog.py index 669b04f3..53a6fe34 100644 --- a/openstackclient/identity/v2_0/catalog.py +++ b/openstackclient/identity/v2_0/catalog.py @@ -25,7 +25,9 @@ def _format_endpoints(eps=None): return "" ret = '' for index, ep in enumerate(eps): - region = eps[index].get('region', '<none>') + region = eps[index].get('region') + if region is None: + region = '<none>' ret += region + '\n' for endpoint_type in ['publicURL', 'internalURL', 'adminURL']: url = eps[index].get(endpoint_type) diff --git a/openstackclient/identity/v3/catalog.py b/openstackclient/identity/v3/catalog.py index 38a57d90..78d71f59 100644 --- a/openstackclient/identity/v3/catalog.py +++ b/openstackclient/identity/v3/catalog.py @@ -25,7 +25,7 @@ def _format_endpoints(eps=None): return "" ret = '' for ep in eps: - region = ep.get('region_id') or ep.get('region', '<none>') + region = ep.get('region_id') or ep.get('region') or '<none>' ret += region + '\n' ret += " %s: %s\n" % (ep['interface'], ep['url']) return ret |
