From ce8345259dafe47d84c1efd4d97447fb15ad3b4d Mon Sep 17 00:00:00 2001 From: Haiwei Xu Date: Mon, 21 Dec 2015 16:12:12 +0900 Subject: [PATCH] Make event-list sort_keys all workable Currently when listing events, user can sort events by keys like 'user' and 'obj_name', but these columns are not in the list which makes the sorting meanless. Because 'user' is almost always keeping the same, so don't use it as a sort key, adding 'level' as a sort key. Change-Id: I3b298f660faf81e69431320248bc6b342faff3b2 Closes-bug: #1528103 --- senlinclient/v1/shell.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index e34995a9..2194b268 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -1215,9 +1215,9 @@ def do_event_list(sc, args): def _short_obj_id(obj): return obj.obj_id[:8] if obj.obj_id else '' - fields = ['id', 'timestamp', 'obj_type', 'obj_id', 'action', 'status', - 'status_reason'] - sort_keys = ['timestamp', 'obj_type', 'obj_name', 'user', 'action'] + fields = ['id', 'timestamp', 'obj_type', 'obj_id', 'obj_name', 'action', + 'status', 'status_reason', 'level'] + sort_keys = ['timestamp', 'obj_type', 'obj_name', 'level', 'action'] queries = { 'sort_keys': args.sort_keys,