From ff91e26983578bf1b77e1d68fb1ae26067eed7ea Mon Sep 17 00:00:00 2001 From: lihaijing <lihaijing@fiberhome.com> Date: Wed, 23 Aug 2017 11:23:27 +0800 Subject: [PATCH] Update image cli doc and fix some typos Change-Id: I0a8d095e51a96804c97612e28fac2d00aa94c638 Closes-Bug: #1711284 --- doc/source/cli/command-objects/image.rst | 68 ++++++++++++++---------- openstackclient/image/v2/image.py | 2 +- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/doc/source/cli/command-objects/image.rst b/doc/source/cli/command-objects/image.rst index 92efd0a546..e2257bbbba 100644 --- a/doc/source/cli/command-objects/image.rst +++ b/doc/source/cli/command-objects/image.rst @@ -16,7 +16,8 @@ Associate project with image openstack image add project [--project-domain <project-domain>] - <image> <project> + <image> + <project> .. option:: --project-domain <project-domain> @@ -60,7 +61,8 @@ Create/upload an image [--public | --private | --community | --shared] [--property <key=value> [...] ] [--tag <tag> [...] ] - [--project <project> [--project-domain <project-domain>]] + [--project <project>] + [--project-domain <project-domain>] <image-name> .. option:: --id <id> @@ -153,11 +155,11 @@ Create/upload an image .. option:: --property <key=value> - Set a property on this image (repeat for multiple values) + Set a property on this image (repeat option to set multiple properties) .. option:: --tag <tag> - Set a tag on this image (repeat for multiple values) + Set a tag on this image (repeat option to set multiple tags) .. versionadded:: 2 @@ -205,13 +207,12 @@ List available images openstack image list [--public | --private | --shared] [--property <key=value>] + [--name <name>] + [--status <status>] [--long] [--sort <key>[:<direction>]] [--limit <num-images>] [--marker <image>] - [--name <name>] - [--status <status>] - .. option:: --public @@ -231,6 +232,18 @@ List available images Filter output based on property +.. option:: --name <name> + + Filter images based on name + + *Image version 2 only.* + +.. option:: --status <status> + + Filter images based on status + + *Image version 2 only* + .. option:: --long List additional fields in output @@ -251,15 +264,6 @@ List available images The last image of the previous page. Display list of images after marker. Display all images if not specified. (name or ID) -.. option:: --name <name> - - Filter images based on name - -.. option:: --status <status> - - Filter images based on status - - *Image version 2 only* image remove project @@ -272,7 +276,7 @@ Disassociate project with image .. program:: image remove project .. code:: bash - openstack image remove remove + openstack image remove project [--project-domain <project-domain>] <image> <project> @@ -347,8 +351,9 @@ Set image properties [--os-distro <os-distro>] [--os-version <os-version>] [--ramdisk-id <ramdisk-id>] - [--activate|--deactivate] - [--project <project> [--project-domain <project-domain>]] + [--deactivate | --activate] + [--project <project>] + [--project-domain <project-domain>] [--accept | --reject | --pending] <image> @@ -460,7 +465,7 @@ Set image properties .. option:: --tag <tag> - Set a tag on this image (repeat for multiple values) + Set a tag on this image (repeat option to set multiple tags) .. versionadded:: 2 @@ -500,18 +505,18 @@ Set image properties .. versionadded:: 2 -.. option:: --activate - - Activate the image. - - .. versionadded:: 2 - .. option:: --deactivate Deactivate the image. .. versionadded:: 2 +.. option:: --activate + + Activate the image. + + .. versionadded:: 2 + .. option:: --project <project> Set an alternate project on this image (name or ID). @@ -568,8 +573,13 @@ Display image details .. code:: bash openstack image show + [--human-readable] <image> +.. option:: --human-readable + + Print image size in a human-friendly format. + .. _image_show-image: .. describe:: <image> @@ -585,16 +595,16 @@ Unset image tags or properties .. program:: image unset .. code:: bash - openstack image set + openstack image unset [--tag <tag>] - [--property <property>] + [--property <property-key>] <image> .. option:: --tag <tag> Unset a tag on this image (repeat option to unset multiple tags) -.. option:: --property <property> +.. option:: --property <property-key> Unset a property on this image (repeat option to unset multiple properties) diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 30dd938055..a2e45fc707 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -995,7 +995,7 @@ class UnsetImage(command.Command): parser.add_argument( "--property", dest="properties", - metavar="<property_key>", + metavar="<property-key>", default=[], action='append', help=_("Unset a property on this image "