From 7829aca70459753d7df0e197f4bf6090542f9b7b Mon Sep 17 00:00:00 2001 From: Guojian Shao Date: Wed, 15 Jul 2015 12:37:30 +0800 Subject: only return endpoints that have url Change-Id: I97a502252c0c377fce573e92b83c0122812f6f80 Closes-Bug: #1474656 --- openstackclient/identity/v2_0/catalog.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'openstackclient/identity') diff --git a/openstackclient/identity/v2_0/catalog.py b/openstackclient/identity/v2_0/catalog.py index c10001d0..e166c855 100644 --- a/openstackclient/identity/v2_0/catalog.py +++ b/openstackclient/identity/v2_0/catalog.py @@ -30,8 +30,10 @@ def _format_endpoints(eps=None): for index, ep in enumerate(eps): region = eps[index].get('region', '') ret += region + '\n' - for url in ['publicURL', 'internalURL', 'adminURL']: - ret += " %s: %s\n" % (url, eps[index][url]) + for endpoint_type in ['publicURL', 'internalURL', 'adminURL']: + url = eps[index].get(endpoint_type) + if url: + ret += " %s: %s\n" % (endpoint_type, url) return ret -- cgit v1.2.1