glance image-show now have --human-readable option
Added option '--human-readable' to image-show cli which allows users to display image size in human-readable format. Change-Id: Ic3452ce4560d3cf90fa7f59f98e5ff42e804f8c9 Closes-Bug: #1434381
This commit is contained in:
@@ -372,10 +372,12 @@ def strip_version(endpoint):
|
||||
return endpoint, version
|
||||
|
||||
|
||||
def print_image(image_obj, max_col_width=None):
|
||||
def print_image(image_obj, human_readable=False, max_col_width=None):
|
||||
ignore = ['self', 'access', 'file', 'schema']
|
||||
image = dict([item for item in six.iteritems(image_obj)
|
||||
if item[0] not in ignore])
|
||||
if human_readable:
|
||||
image['size'] = make_size_human_readable(image['size'])
|
||||
if str(max_col_width).isdigit():
|
||||
print_dict(image, max_column_width=max_col_width)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user