From 53c097aea689b777ed939ab7fa175c220b471796 Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI <motoki@da.jp.nec.com> Date: Mon, 3 Dec 2012 13:42:00 +0900 Subject: [PATCH] Display columns in the order of -c options Fixes bug 1085785 Change-Id: Ifd8ddfbb7fa5e32be96febe981a6baf57b5e58c7 --- quantumclient/quantum/v2_0/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quantumclient/quantum/v2_0/__init__.py b/quantumclient/quantum/v2_0/__init__.py index b067d32..c73795b 100644 --- a/quantumclient/quantum/v2_0/__init__.py +++ b/quantumclient/quantum/v2_0/__init__.py @@ -387,7 +387,9 @@ class ListCommand(QuantumCommand, lister.Lister): if not _columns: # clean the parsed_args.columns so that cliff will not break parsed_args.columns = [] - elif not parsed_args.columns and self.list_columns: + elif parsed_args.columns: + _columns = [x for x in parsed_args.columns if x in _columns] + elif self.list_columns: # if no -c(s) by user and list_columns, we use columns in # both list_columns and returned resource. # Also Keep their order the same as in list_columns