Adding size field cue cluster list command
Closes-bug: 1438939 Change-Id: I54aee8e9f7f088b4f9a9d1b9c75d8260ace0f154
This commit is contained in:
parent
0c7559b9a1
commit
14e5f05af0
|
@ -23,14 +23,15 @@ class TestListClusters(base.TestCueBase):
|
||||||
verifylist = []
|
verifylist = []
|
||||||
expected = {'00000000-0000-0000-0000-000000001234':
|
expected = {'00000000-0000-0000-0000-000000001234':
|
||||||
('00000000-0000-0000-0000-000000001234',
|
('00000000-0000-0000-0000-000000001234',
|
||||||
'test-cluster', 'ACTIVE', []),
|
'test-cluster', 'ACTIVE', 1, []),
|
||||||
'00000000-0000-0000-0000-000000005678':
|
'00000000-0000-0000-0000-000000005678':
|
||||||
('00000000-0000-0000-0000-000000005678',
|
('00000000-0000-0000-0000-000000005678',
|
||||||
'test-cluster2', 'BUILDING', [])}
|
'test-cluster2', 'BUILDING', 3, [])}
|
||||||
|
|
||||||
result = self.execute(clusters.ListClustersCommand, arglist,
|
result = self.execute(clusters.ListClustersCommand, arglist,
|
||||||
verifylist)
|
verifylist)
|
||||||
self.assertEqual(['id', 'name', 'status', 'endpoints'], result[0])
|
self.assertEqual(['id', 'name', 'status', 'size', 'endpoints'],
|
||||||
|
result[0])
|
||||||
self.assert_called('GET', '/clusters')
|
self.assert_called('GET', '/clusters')
|
||||||
for cluster in result[1]:
|
for cluster in result[1]:
|
||||||
self.assertEqual(expected[cluster[0]], cluster)
|
self.assertEqual(expected[cluster[0]], cluster)
|
||||||
|
|
|
@ -29,7 +29,7 @@ LOG = logging.getLogger(__name__)
|
||||||
class ListClustersCommand(lister.Lister):
|
class ListClustersCommand(lister.Lister):
|
||||||
"""List Clusters"""
|
"""List Clusters"""
|
||||||
|
|
||||||
columns = ['id', 'name', 'status', 'endpoints']
|
columns = ['id', 'name', 'status', 'size', 'endpoints']
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
parser = super(ListClustersCommand, self).get_parser(prog_name)
|
parser = super(ListClustersCommand, self).get_parser(prog_name)
|
||||||
|
|
Loading…
Reference in New Issue