diff options
| author | Zuul <zuul@review.opendev.org> | 2020-12-02 04:45:15 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2020-12-02 04:45:15 +0000 |
| commit | ea358057f8c89adbf3d077f1f31036baf1710c59 (patch) | |
| tree | a2d91bb326d9cb3b2dfba1272465b8f370ba0e51 /openstackclient/image/v2/image.py | |
| parent | d4a0bcf8b3b46db4a368f423061ac5806a8021c9 (diff) | |
| parent | 5bdcd590ecacbc0aa8db2cbafa0ab1a9f3c28ce0 (diff) | |
| download | python-openstackclient-ea358057f8c89adbf3d077f1f31036baf1710c59.tar.gz | |
Merge "stop image downloads to memory"
Diffstat (limited to 'openstackclient/image/v2/image.py')
| -rw-r--r-- | openstackclient/image/v2/image.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 4f3e9d0b..58d92f51 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -803,7 +803,11 @@ class SaveImage(command.Command): image_client = self.app.client_manager.image image = image_client.find_image(parsed_args.image) - image_client.download_image(image.id, output=parsed_args.file) + output_file = parsed_args.file + if output_file is None: + output_file = getattr(sys.stdout, "buffer", sys.stdout) + + image_client.download_image(image.id, stream=True, output=output_file) class SetImage(command.Command): |
