From df9cbca298f2a5b70842f3ad7faede7440a5e863 Mon Sep 17 00:00:00 2001 From: Haiwei Xu Date: Mon, 21 Dec 2015 17:18:10 +0900 Subject: [PATCH] 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 --- senlinclient/tests/unit/v1/test_shell.py | 4 ++-- senlinclient/v1/shell.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/senlinclient/tests/unit/v1/test_shell.py b/senlinclient/tests/unit/v1/test_shell.py index 38c502de..10fefce3 100644 --- a/senlinclient/tests/unit/v1/test_shell.py +++ b/senlinclient/tests/unit/v1/test_shell.py @@ -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', diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index e4fad771..fe435078 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -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 = {