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):
|
def _format_endpoints(eps=None):
|
||||||
if not eps:
|
if not eps:
|
||||||
return ""
|
return ""
|
||||||
|
ret = ''
|
||||||
for index, ep in enumerate(eps):
|
for index, ep in enumerate(eps):
|
||||||
ret = eps[index]['region'] + '\n'
|
ret += eps[index]['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]['publicURL'])
|
||||||
return ret
|
return ret
|
||||||
|
@ -23,11 +23,18 @@ class TestCatalog(utils.TestCommand):
|
|||||||
'id': 'qwertyuiop',
|
'id': 'qwertyuiop',
|
||||||
'type': 'compute',
|
'type': 'compute',
|
||||||
'name': 'supernova',
|
'name': 'supernova',
|
||||||
'endpoints': [{
|
'endpoints': [
|
||||||
'region': 'onlyone',
|
{
|
||||||
'publicURL': 'https://public.example.com',
|
'region': 'one',
|
||||||
'adminURL': 'https://admin.example.com',
|
'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):
|
def setUp(self):
|
||||||
@ -66,9 +73,12 @@ class TestCatalogList(TestCatalog):
|
|||||||
datalist = ((
|
datalist = ((
|
||||||
'supernova',
|
'supernova',
|
||||||
'compute',
|
'compute',
|
||||||
'onlyone\n publicURL: https://public.example.com\n '
|
'one\n publicURL: https://public.one.example.com\n '
|
||||||
'internalURL: https://public.example.com\n '
|
'internalURL: https://public.one.example.com\n '
|
||||||
'adminURL: https://public.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))
|
self.assertEqual(datalist, tuple(data))
|
||||||
|
|
||||||
@ -97,9 +107,12 @@ class TestCatalogShow(TestCatalog):
|
|||||||
collist = ('endpoints', 'id', 'name', 'type')
|
collist = ('endpoints', 'id', 'name', 'type')
|
||||||
self.assertEqual(collist, columns)
|
self.assertEqual(collist, columns)
|
||||||
datalist = (
|
datalist = (
|
||||||
'onlyone\n publicURL: https://public.example.com\n '
|
'one\n publicURL: https://public.one.example.com\n '
|
||||||
'internalURL: https://public.example.com\n '
|
'internalURL: https://public.one.example.com\n '
|
||||||
'adminURL: https://public.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',
|
'qwertyuiop',
|
||||||
'supernova',
|
'supernova',
|
||||||
'compute',
|
'compute',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user