diff options
| author | Zuul <zuul@review.opendev.org> | 2019-05-23 07:08:51 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-05-23 07:08:51 +0000 |
| commit | ee74e8f2e84e7905a518ea84c32f79cb6f9b8a23 (patch) | |
| tree | 1cfe87bb9e2a922885749e06adfb4dbae9da330d /cinderclient/v3 | |
| parent | 083391ba0d5488b957b31bbc669687d5848cb3ee (diff) | |
| parent | 274fa111696783e846561d12f670967ed01ebcbc (diff) | |
| download | python-cinderclient-ee74e8f2e84e7905a518ea84c32f79cb6f9b8a23.tar.gz | |
Merge "Fix shell upload-to-image with no volume type"
Diffstat (limited to 'cinderclient/v3')
| -rw-r--r-- | cinderclient/v3/shell.py | 25 | ||||
| -rw-r--r-- | cinderclient/v3/volumes.py | 1 |
2 files changed, 14 insertions, 12 deletions
diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py index fefec60..121fbd9 100644 --- a/cinderclient/v3/shell.py +++ b/cinderclient/v3/shell.py @@ -964,19 +964,20 @@ def do_upload_to_image(cs, args): """Uploads volume to Image Service as an image.""" volume = utils.find_volume(cs, args.volume) if cs.api_version >= api_versions.APIVersion("3.1"): - shell_utils.print_volume_image( - volume.upload_to_image(args.force, - args.image_name, - args.container_format, - args.disk_format, - args.visibility, - args.protected)) + (resp, body) = volume.upload_to_image(args.force, + args.image_name, + args.container_format, + args.disk_format, + args.visibility, + args.protected) + + shell_utils.print_volume_image((resp, body)) else: - shell_utils.print_volume_image( - volume.upload_to_image(args.force, - args.image_name, - args.container_format, - args.disk_format)) + (resp, body) = volume.upload_to_image(args.force, + args.image_name, + args.container_format, + args.disk_format) + shell_utils.print_volume_image((resp, body)) @utils.arg('volume', metavar='<volume>', help='ID of volume to migrate.') diff --git a/cinderclient/v3/volumes.py b/cinderclient/v3/volumes.py index 33850a3..d4b9637 100644 --- a/cinderclient/v3/volumes.py +++ b/cinderclient/v3/volumes.py @@ -37,6 +37,7 @@ class Volume(volumes.Volume): 3.1-latest). :param protected: Boolean to decide whether prevents image from being deleted (allowed for 3.1-latest). + :returns: tuple (response, body) """ if self.manager.api_version >= api_versions.APIVersion("3.1"): visibility = 'private' if visibility is None else visibility |
