summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-02-27 05:00:57 +0000
committerGerrit Code Review <review@openstack.org>2017-02-27 05:00:57 +0000
commitc6059bed4ae5fe6d6816c6ab1d56a763366b3cc9 (patch)
tree53a2295531fb0634252e03b83cc61fb98de1f39f /openstackclient
parente5ee4b8ca3a1de9208ea0e05efec4162c4b9d6a4 (diff)
parent4ea4f6fabb5bd45f15f21fc5d84f0f85032e4f23 (diff)
downloadpython-openstackclient-c6059bed4ae5fe6d6816c6ab1d56a763366b3cc9.tar.gz
Merge "openstack image create : --file and --volume exclude each other"
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/image/v1/image.py5
-rw-r--r--openstackclient/image/v2/image.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/openstackclient/image/v1/image.py b/openstackclient/image/v1/image.py
index f4944afa..60d61709 100644
--- a/openstackclient/image/v1/image.py
+++ b/openstackclient/image/v1/image.py
@@ -128,12 +128,13 @@ class CreateImage(command.ShowOne):
metavar="<image-url>",
help=_("Copy image from the data store (similar to --location)"),
)
- parser.add_argument(
+ source_group = parser.add_mutually_exclusive_group()
+ source_group.add_argument(
"--file",
metavar="<file>",
help=_("Upload image from local file"),
)
- parser.add_argument(
+ source_group.add_argument(
"--volume",
metavar="<volume>",
help=_("Create image from a volume"),
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py
index 29499ec2..c4be69f0 100644
--- a/openstackclient/image/v2/image.py
+++ b/openstackclient/image/v2/image.py
@@ -164,12 +164,13 @@ class CreateImage(command.ShowOne):
type=int,
help=_("Minimum RAM size needed to boot image, in megabytes"),
)
- parser.add_argument(
+ source_group = parser.add_mutually_exclusive_group()
+ source_group.add_argument(
"--file",
metavar="<file>",
help=_("Upload image from local file"),
)
- parser.add_argument(
+ source_group.add_argument(
"--volume",
metavar="<volume>",
help=_("Create image from a volume"),