Skip to content

Commit 0efc866

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Fix identity v2 catalog list"
2 parents 5d98bb3 + d05b5e1 commit 0efc866

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

openstackclient/identity/v2_0/catalog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
def _format_endpoints(eps=None):
2727
if not eps:
2828
return ""
29+
ret = ''
2930
for index, ep in enumerate(eps):
30-
ret = eps[index]['region'] + '\n'
31+
ret += eps[index]['region'] + '\n'
3132
for url in ['publicURL', 'internalURL', 'adminURL']:
3233
ret += " %s: %s\n" % (url, eps[index]['publicURL'])
3334
return ret

openstackclient/tests/identity/v2_0/test_catalog.py

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@ class TestCatalog(utils.TestCommand):
2323
'id': 'qwertyuiop',
2424
'type': 'compute',
2525
'name': 'supernova',
26-
'endpoints': [{
27-
'region': 'onlyone',
28-
'publicURL': 'https://public.example.com',
29-
'adminURL': 'https://admin.example.com',
30-
}],
26+
'endpoints': [
27+
{
28+
'region': 'one',
29+
'publicURL': 'https://public.one.example.com',
30+
'adminURL': 'https://admin.one.example.com',
31+
},
32+
{
33+
'region': 'two',
34+
'publicURL': 'https://public.two.example.com',
35+
'adminURL': 'https://admin.two.example.com',
36+
},
37+
],
3138
}
3239

3340
def setUp(self):
@@ -66,9 +73,12 @@ def test_catalog_list(self):
6673
datalist = ((
6774
'supernova',
6875
'compute',
69-
'onlyone\n publicURL: https://public.example.com\n '
70-
'internalURL: https://public.example.com\n '
71-
'adminURL: https://public.example.com\n',
76+
'one\n publicURL: https://public.one.example.com\n '
77+
'internalURL: https://public.one.example.com\n '
78+
'adminURL: https://public.one.example.com\n'
79+
'two\n publicURL: https://public.two.example.com\n '
80+
'internalURL: https://public.two.example.com\n '
81+
'adminURL: https://public.two.example.com\n',
7282
), )
7383
self.assertEqual(datalist, tuple(data))
7484

@@ -97,9 +107,12 @@ def test_catalog_show(self):
97107
collist = ('endpoints', 'id', 'name', 'type')
98108
self.assertEqual(collist, columns)
99109
datalist = (
100-
'onlyone\n publicURL: https://public.example.com\n '
101-
'internalURL: https://public.example.com\n '
102-
'adminURL: https://public.example.com\n',
110+
'one\n publicURL: https://public.one.example.com\n '
111+
'internalURL: https://public.one.example.com\n '
112+
'adminURL: https://public.one.example.com\n'
113+
'two\n publicURL: https://public.two.example.com\n '
114+
'internalURL: https://public.two.example.com\n '
115+
'adminURL: https://public.two.example.com\n',
103116
'qwertyuiop',
104117
'supernova',
105118
'compute',

0 commit comments

Comments
 (0)