summaryrefslogtreecommitdiff
path: root/openstackclient/image/v2
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/image/v2')
-rw-r--r--openstackclient/image/v2/image.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py
index 657277c0..cb3537b6 100644
--- a/openstackclient/image/v2/image.py
+++ b/openstackclient/image/v2/image.py
@@ -849,6 +849,12 @@ class ShowImage(command.ShowOne):
def get_parser(self, prog_name):
parser = super(ShowImage, self).get_parser(prog_name)
parser.add_argument(
+ "--human-readable",
+ default=False,
+ action='store_true',
+ help=_("Print image size in a human-friendly format."),
+ )
+ parser.add_argument(
"image",
metavar="<image>",
help=_("Image to display (name or ID)"),
@@ -861,6 +867,8 @@ class ShowImage(command.ShowOne):
image_client.images,
parsed_args.image,
)
+ if parsed_args.human_readable:
+ image['size'] = utils.format_size(image['size'])
info = _format_image(image)
return zip(*sorted(six.iteritems(info)))