Make sort keys work for node-list and action-list

Some sort_keys columns are not shown in node-list,
and action-list, which will make sort keys meanless,
so add those keys into list fields.

Change-Id: I6dd93a9f9d01dad4b81b43792d88f8495c75264c
Closes-bug: #1528103
This commit is contained in:
Haiwei Xu
2015-12-21 17:18:10 +09:00
parent d14f733765
commit df9cbca298
2 changed files with 4 additions and 4 deletions

View File

@@ -1083,7 +1083,7 @@ class ShellTest(testtools.TestCase):
@mock.patch.object(utils, 'print_list')
def test_do_node_list(self, mock_print):
service = mock.Mock()
fields = ['id', 'name', 'status', 'cluster_id', 'physical_id',
fields = ['id', 'name', 'index', 'status', 'cluster_id', 'physical_id',
'profile_name', 'created_at', 'updated_at']
args = {
'cluster': 'cluster1',
@@ -1318,7 +1318,7 @@ class ShellTest(testtools.TestCase):
def test_do_action_list(self, mock_print):
service = mock.Mock()
fields = ['id', 'name', 'action', 'status', 'target', 'depends_on',
'depended_by']
'depended_by', 'created_at']
args = {
'sort_keys': 'status',
'sort_dir': 'asc',

View File

@@ -873,7 +873,7 @@ def do_cluster_policy_disable(service, args):
def do_node_list(service, args):
"""Show list of nodes."""
fields = ['id', 'name', 'status', 'cluster_id', 'physical_id',
fields = ['id', 'name', 'index', 'status', 'cluster_id', 'physical_id',
'profile_name', 'created_at', 'updated_at']
sort_keys = ['index', 'name', 'created_at', 'updated_at', 'status']
@@ -1255,7 +1255,7 @@ def do_action_list(service, args):
"""List actions."""
fields = ['id', 'name', 'action', 'status', 'target', 'depends_on',
'depended_by']
'depended_by', 'created_at']
sort_keys = ['name', 'target', 'action', 'created_at', 'status']
queries = {