Skip to content

Commit

Permalink
Display acceptable disk/container formats in help text
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bcwaldon authored and Sathish Nagappan committed Oct 4, 2012
1 parent cdc06d9 commit b5d46e2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions glanceclient/v1/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,21 @@
#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='<NAME>',
help='Filter images to those that have this name.')
@utils.arg('--status', metavar='<STATUS>',
help='Filter images to those that have this status.')
@utils.arg('--container-format', metavar='<CONTAINER_FORMAT>',
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='<DISK_FORMAT>',
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='<SIZE>',
help='Filter images to those with a size greater than this.')
@utils.arg('--size-max', metavar='<SIZE>',
Expand Down Expand Up @@ -109,9 +115,9 @@ def do_image_download(gc, args):
@utils.arg('--name', metavar='<NAME>',
help='Name of image.')
@utils.arg('--disk-format', metavar='<DISK_FORMAT>',
help='Disk format of image.')
help='Disk format of image. ' + DISK_FORMATS)
@utils.arg('--container-format', metavar='<CONTAINER_FORMAT>',
help='Container format of image.')
help='Container format of image. ' + CONTAINER_FORMATS)
@utils.arg('--owner', metavar='<TENANT_ID>',
help='Tenant who should own image.')
@utils.arg('--size', metavar='<SIZE>',
Expand Down Expand Up @@ -177,9 +183,9 @@ def do_image_create(gc, args):
@utils.arg('--name', metavar='<NAME>',
help='Name of image.')
@utils.arg('--disk-format', metavar='<CONTAINER_FORMAT>',
help='Disk format of image.')
help='Disk format of image. ' + CONTAINER_FORMATS)
@utils.arg('--container-format', metavar='<DISK_FORMAT>',
help='Container format of image.')
help='Container format of image. ' + DISK_FORMATS)
@utils.arg('--owner', metavar='<TENANT_ID>',
help='Tenant who should own image.')
@utils.arg('--size', metavar='<SIZE>',
Expand Down

0 comments on commit b5d46e2

Please sign in to comment.