From b5d46e2e0d1e5df7f953787987b88880eb844b9d Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 3 Oct 2012 13:52:55 -0700 Subject: [PATCH] Display acceptable disk/container formats in help text Fixes bug #1056497 This patch provides more information in the help text. Originally the text provided the trivial definitions of the arguments disk_format and container_format. This patch updates the text to display the acceptable formats. Change-Id: I893b52c9f72a34c75e8bea522820863592300302 --- glanceclient/v1/shell.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py index df2dbd7a..5e15f6f1 100644 --- a/glanceclient/v1/shell.py +++ b/glanceclient/v1/shell.py @@ -29,15 +29,21 @@ import glanceclient.v1.images #NOTE(bcwaldon): import deprecated cli functions from glanceclient.v1.legacy_shell import * +CONTAINER_FORMATS = 'Acceptable formats: ami, ari, aki, bare, and ovf.' +DISK_FORMATS = ('Acceptable formats: ami, ari, aki, vhd, vmdk, raw, ' + 'qcow2, vdi, and iso.') + @utils.arg('--name', metavar='', help='Filter images to those that have this name.') @utils.arg('--status', metavar='', help='Filter images to those that have this status.') @utils.arg('--container-format', metavar='', - help='Filter images to those that have this container format.') + help='Filter images to those that have this container format. ' + + CONTAINER_FORMATS) @utils.arg('--disk-format', metavar='', - help='Filter images to those that have this disk format.') + help='Filter images to those that have this disk format. ' + + DISK_FORMATS) @utils.arg('--size-min', metavar='', help='Filter images to those with a size greater than this.') @utils.arg('--size-max', metavar='', @@ -109,9 +115,9 @@ def do_image_download(gc, args): @utils.arg('--name', metavar='', help='Name of image.') @utils.arg('--disk-format', metavar='', - help='Disk format of image.') + help='Disk format of image. ' + DISK_FORMATS) @utils.arg('--container-format', metavar='', - help='Container format of image.') + help='Container format of image. ' + CONTAINER_FORMATS) @utils.arg('--owner', metavar='', help='Tenant who should own image.') @utils.arg('--size', metavar='', @@ -177,9 +183,9 @@ def do_image_create(gc, args): @utils.arg('--name', metavar='', help='Name of image.') @utils.arg('--disk-format', metavar='', - help='Disk format of image.') + help='Disk format of image. ' + CONTAINER_FORMATS) @utils.arg('--container-format', metavar='', - help='Container format of image.') + help='Container format of image. ' + DISK_FORMATS) @utils.arg('--owner', metavar='', help='Tenant who should own image.') @utils.arg('--size', metavar='',