Merge "openstack catalog list always returns publicURL for internalURL and adminURL"

This commit is contained in:
Jenkins 2015-07-09 15:58:34 +00:00 committed by Gerrit Code Review
commit 35dc2bed9e
2 changed files with 11 additions and 9 deletions

View File

@ -31,7 +31,7 @@ def _format_endpoints(eps=None):
region = eps[index].get('region', '<none>') region = eps[index].get('region', '<none>')
ret += region + '\n' ret += region + '\n'
for url in ['publicURL', 'internalURL', 'adminURL']: for url in ['publicURL', 'internalURL', 'adminURL']:
ret += " %s: %s\n" % (url, eps[index]['publicURL']) ret += " %s: %s\n" % (url, eps[index][url])
return ret return ret

View File

@ -27,11 +27,13 @@ class TestCatalog(utils.TestCommand):
{ {
'region': 'one', 'region': 'one',
'publicURL': 'https://public.one.example.com', 'publicURL': 'https://public.one.example.com',
'internalURL': 'https://internal.one.example.com',
'adminURL': 'https://admin.one.example.com', 'adminURL': 'https://admin.one.example.com',
}, },
{ {
'region': 'two', 'region': 'two',
'publicURL': 'https://public.two.example.com', 'publicURL': 'https://public.two.example.com',
'internalURL': 'https://internal.two.example.com',
'adminURL': 'https://admin.two.example.com', 'adminURL': 'https://admin.two.example.com',
}, },
], ],
@ -74,11 +76,11 @@ class TestCatalogList(TestCatalog):
'supernova', 'supernova',
'compute', 'compute',
'one\n publicURL: https://public.one.example.com\n ' 'one\n publicURL: https://public.one.example.com\n '
'internalURL: https://public.one.example.com\n ' 'internalURL: https://internal.one.example.com\n '
'adminURL: https://public.one.example.com\n' 'adminURL: https://admin.one.example.com\n'
'two\n publicURL: https://public.two.example.com\n ' 'two\n publicURL: https://public.two.example.com\n '
'internalURL: https://public.two.example.com\n ' 'internalURL: https://internal.two.example.com\n '
'adminURL: https://public.two.example.com\n', 'adminURL: https://admin.two.example.com\n',
), ) ), )
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
@ -108,11 +110,11 @@ class TestCatalogShow(TestCatalog):
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
'one\n publicURL: https://public.one.example.com\n ' 'one\n publicURL: https://public.one.example.com\n '
'internalURL: https://public.one.example.com\n ' 'internalURL: https://internal.one.example.com\n '
'adminURL: https://public.one.example.com\n' 'adminURL: https://admin.one.example.com\n'
'two\n publicURL: https://public.two.example.com\n ' 'two\n publicURL: https://public.two.example.com\n '
'internalURL: https://public.two.example.com\n ' 'internalURL: https://internal.two.example.com\n '
'adminURL: https://public.two.example.com\n', 'adminURL: https://admin.two.example.com\n',
'qwertyuiop', 'qwertyuiop',
'supernova', 'supernova',
'compute', 'compute',