Revision 44f510e1 snf-astakos-app/astakos/im/management/commands/user-show.py

b/snf-astakos-app/astakos/im/management/commands/user-show.py
41 41
from synnefo.webproject.management.commands import SynnefoCommand
42 42
from synnefo.webproject.management import utils
43 43

  
44
from ._common import format, show_quotas
44
from ._common import format, show_quotas, style_options, check_style
45 45

  
46 46
import uuid
47 47

  
......
56 56
                    dest='list_quotas',
57 57
                    default=False,
58 58
                    help="Also list user quota"),
59
        make_option('--unit-style',
60
                    default='mb',
61
                    help=("Specify display unit for resource values "
62
                          "(one of %s); defaults to mb") % style_options),
59 63
        make_option('--projects',
60 64
                    action='store_true',
61 65
                    dest='list_projects',
......
122 126
                               options["output_format"], vertical=True)
123 127

  
124 128
            if options["list_quotas"]:
129
                unit_style = options["unit_style"]
130
                check_style(unit_style)
131

  
125 132
                quotas, initial = list_user_quotas([user])
126 133
                if quotas:
127 134
                    self.stdout.write("\n")
128
                    print_data, labels = show_quotas(quotas, initial)
135
                    print_data, labels = show_quotas(quotas, initial,
136
                                                     style=unit_style)
129 137
                    utils.pprint_table(self.stdout, print_data, labels,
130 138
                                       options["output_format"],
131 139
                                       title="User Quota")

Also available in: Unified diff