diff --git a/openstackclient/identity/v2_0/catalog.py b/openstackclient/identity/v2_0/catalog.py index 7d17fbf586..c10001d0df 100644 --- a/openstackclient/identity/v2_0/catalog.py +++ b/openstackclient/identity/v2_0/catalog.py @@ -31,7 +31,7 @@ def _format_endpoints(eps=None): region = eps[index].get('region', '') ret += region + '\n' for url in ['publicURL', 'internalURL', 'adminURL']: - ret += " %s: %s\n" % (url, eps[index]['publicURL']) + ret += " %s: %s\n" % (url, eps[index][url]) return ret diff --git a/openstackclient/tests/identity/v2_0/test_catalog.py b/openstackclient/tests/identity/v2_0/test_catalog.py index 5044595434..fe13d78d02 100644 --- a/openstackclient/tests/identity/v2_0/test_catalog.py +++ b/openstackclient/tests/identity/v2_0/test_catalog.py @@ -27,11 +27,13 @@ class TestCatalog(utils.TestCommand): { 'region': 'one', 'publicURL': 'https://public.one.example.com', + 'internalURL': 'https://internal.one.example.com', 'adminURL': 'https://admin.one.example.com', }, { 'region': 'two', 'publicURL': 'https://public.two.example.com', + 'internalURL': 'https://internal.two.example.com', 'adminURL': 'https://admin.two.example.com', }, ], @@ -74,11 +76,11 @@ class TestCatalogList(TestCatalog): 'supernova', 'compute', 'one\n publicURL: https://public.one.example.com\n ' - 'internalURL: https://public.one.example.com\n ' - 'adminURL: https://public.one.example.com\n' + 'internalURL: https://internal.one.example.com\n ' + 'adminURL: https://admin.one.example.com\n' 'two\n publicURL: https://public.two.example.com\n ' - 'internalURL: https://public.two.example.com\n ' - 'adminURL: https://public.two.example.com\n', + 'internalURL: https://internal.two.example.com\n ' + 'adminURL: https://admin.two.example.com\n', ), ) self.assertEqual(datalist, tuple(data)) @@ -108,11 +110,11 @@ class TestCatalogShow(TestCatalog): self.assertEqual(collist, columns) datalist = ( 'one\n publicURL: https://public.one.example.com\n ' - 'internalURL: https://public.one.example.com\n ' - 'adminURL: https://public.one.example.com\n' + 'internalURL: https://internal.one.example.com\n ' + 'adminURL: https://admin.one.example.com\n' 'two\n publicURL: https://public.two.example.com\n ' - 'internalURL: https://public.two.example.com\n ' - 'adminURL: https://public.two.example.com\n', + 'internalURL: https://internal.two.example.com\n ' + 'adminURL: https://admin.two.example.com\n', 'qwertyuiop', 'supernova', 'compute',