Merge "Fix keystoneclient user-list output order"

This commit is contained in:
Jenkins 2012-12-13 23:37:29 +00:00 committed by Gerrit Code Review
commit 475d6bba0f

View File

@ -20,7 +20,7 @@ def pretty_choice_list(l):
return ', '.join("'%s'" % i for i in l)
def print_list(objs, fields, formatters={}):
def print_list(objs, fields, formatters={}, order_by=None):
pt = prettytable.PrettyTable([f for f in fields], caching=False)
pt.aligns = ['l' for f in fields]
@ -37,7 +37,9 @@ def print_list(objs, fields, formatters={}):
row.append(data)
pt.add_row(row)
print pt.get_string(sortby=fields[0])
if order_by is None:
order_by = fields[0]
print pt.get_string(sortby=order_by)
def _word_wrap(string, max_length=0):