summaryrefslogtreecommitdiff
path: root/openstackclient/image
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/image')
-rw-r--r--openstackclient/image/v2/image.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py
index 53ce560d..b068ddaf 100644
--- a/openstackclient/image/v2/image.py
+++ b/openstackclient/image/v2/image.py
@@ -324,6 +324,14 @@ class CreateImage(command.ShowOne):
metavar="<project>",
help=_("Set an alternate project on this image (name or ID)"),
)
+ parser.add_argument(
+ "--import",
+ dest="use_import",
+ action="store_true",
+ help=_(
+ "Force the use of glance image import instead of"
+ " direct upload")
+ )
common.add_project_domain_option_to_parser(parser)
for deadopt in self.deadopts:
parser.add_argument(
@@ -388,6 +396,9 @@ class CreateImage(command.ShowOne):
parsed_args.project_domain,
).id
+ if parsed_args.use_import:
+ kwargs['use_import'] = True
+
# open the file first to ensure any failures are handled before the
# image is created. Get the file name (if it is file, and not stdin)
# for easier further handling.