summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-03-08 17:59:09 +0000
committerGerrit Code Review <review@openstack.org>2015-03-08 17:59:09 +0000
commit0efc8668bf85baccb9126942388680ff60d52b6a (patch)
treebfe7023821a669a2b848097a42c1b9c8be4ef22a /openstackclient
parent5d98bb38003941654161d5db789d80be937b4926 (diff)
parentd05b5e14f13244e269c2bbaa9db6395e37af2b8a (diff)
downloadpython-openstackclient-0efc8668bf85baccb9126942388680ff60d52b6a.tar.gz
Merge "Fix identity v2 catalog list"
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/identity/v2_0/catalog.py3
-rw-r--r--openstackclient/tests/identity/v2_0/test_catalog.py35
2 files changed, 26 insertions, 12 deletions
diff --git a/openstackclient/identity/v2_0/catalog.py b/openstackclient/identity/v2_0/catalog.py
index f6048378..363d5ab2 100644
--- a/openstackclient/identity/v2_0/catalog.py
+++ b/openstackclient/identity/v2_0/catalog.py
@@ -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
diff --git a/openstackclient/tests/identity/v2_0/test_catalog.py b/openstackclient/tests/identity/v2_0/test_catalog.py
index 5289cac4..50445954 100644
--- a/openstackclient/tests/identity/v2_0/test_catalog.py
+++ b/openstackclient/tests/identity/v2_0/test_catalog.py
@@ -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',