Merge "Fix identity v2 catalog list"
This commit is contained in:
commit
0efc8668bf
@ -26,8 +26,9 @@ from openstackclient.i18n import _ # noqa
|
||||
def _format_endpoints(eps=None):
|
||||
if not eps:
|
||||
return ""
|
||||
ret = ''
|
||||
for index, ep in enumerate(eps):
|
||||
ret = eps[index]['region'] + '\n'
|
||||
ret += eps[index]['region'] + '\n'
|
||||
for url in ['publicURL', 'internalURL', 'adminURL']:
|
||||
ret += " %s: %s\n" % (url, eps[index]['publicURL'])
|
||||
return ret
|
||||
|
@ -23,11 +23,18 @@ class TestCatalog(utils.TestCommand):
|
||||
'id': 'qwertyuiop',
|
||||
'type': 'compute',
|
||||
'name': 'supernova',
|
||||
'endpoints': [{
|
||||
'region': 'onlyone',
|
||||
'publicURL': 'https://public.example.com',
|
||||
'adminURL': 'https://admin.example.com',
|
||||
}],
|
||||
'endpoints': [
|
||||
{
|
||||
'region': 'one',
|
||||
'publicURL': 'https://public.one.example.com',
|
||||
'adminURL': 'https://admin.one.example.com',
|
||||
},
|
||||
{
|
||||
'region': 'two',
|
||||
'publicURL': 'https://public.two.example.com',
|
||||
'adminURL': 'https://admin.two.example.com',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
def setUp(self):
|
||||
@ -66,9 +73,12 @@ class TestCatalogList(TestCatalog):
|
||||
datalist = ((
|
||||
'supernova',
|
||||
'compute',
|
||||
'onlyone\n publicURL: https://public.example.com\n '
|
||||
'internalURL: https://public.example.com\n '
|
||||
'adminURL: https://public.example.com\n',
|
||||
'one\n publicURL: https://public.one.example.com\n '
|
||||
'internalURL: https://public.one.example.com\n '
|
||||
'adminURL: https://public.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',
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
@ -97,9 +107,12 @@ class TestCatalogShow(TestCatalog):
|
||||
collist = ('endpoints', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
'onlyone\n publicURL: https://public.example.com\n '
|
||||
'internalURL: https://public.example.com\n '
|
||||
'adminURL: https://public.example.com\n',
|
||||
'one\n publicURL: https://public.one.example.com\n '
|
||||
'internalURL: https://public.one.example.com\n '
|
||||
'adminURL: https://public.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',
|
||||
'qwertyuiop',
|
||||
'supernova',
|
||||
'compute',
|
||||
|
Loading…
x
Reference in New Issue
Block a user