Fixes bug with different fields in query and scan commands

Closes-bug: #1337274
Change-Id: Ic91228c3a78fc016ceb76d8ef2dad880d0784dbf
This commit is contained in:
Andrei V. Ostapenko 2014-07-03 14:42:33 +03:00
parent ec8315ad09
commit b40e6f442e
1 changed files with 6 additions and 1 deletions

View File

@ -541,7 +541,12 @@ class ListCommand(MagnetoDBCommand, lister.Lister):
pass
def setup_columns(self, info, parsed_args):
_columns = len(info) > 0 and sorted(info[0].keys()) or []
_columns = set()
if len(info) > 0:
for item in info:
_columns = _columns.union(item.keys())
else:
_columns = []
if not _columns:
# clean the parsed_args.columns so that cliff will not break
parsed_args.columns = []