diff --git a/openstackclient/image/v1/image.py b/openstackclient/image/v1/image.py index f4944afa6f..60d6170901 100644 --- a/openstackclient/image/v1/image.py +++ b/openstackclient/image/v1/image.py @@ -128,12 +128,13 @@ class CreateImage(command.ShowOne): metavar="", 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="", help=_("Upload image from local file"), ) - parser.add_argument( + source_group.add_argument( "--volume", metavar="", help=_("Create image from a volume"), diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 29499ec2c8..c4be69f055 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="", help=_("Upload image from local file"), ) - parser.add_argument( + source_group.add_argument( "--volume", metavar="", help=_("Create image from a volume"),