summaryrefslogtreecommitdiff
path: root/openstackclient/image
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/image')
-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"),