Merge "Added return statement to retype_volume in v2 volumes_client"
This commit is contained in:
commit
72312d9911
|
@ -318,6 +318,7 @@ class VolumesClient(base_client.BaseClient):
|
|||
post_body = json.dumps({'os-retype': kwargs})
|
||||
resp, body = self.post('volumes/%s/action' % volume_id, post_body)
|
||||
self.expected_success(202, resp.status)
|
||||
return rest_client.ResponseBody(resp, body)
|
||||
|
||||
def force_detach_volume(self, volume_id, **kwargs):
|
||||
"""Force detach a volume.
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fixes:
|
||||
Add a missing return statement to the retype_volume API in the v2 volumes_client library.
|
||||
This changes the response body from None to an empty dictionary.
|
||||
|
|
@ -33,6 +33,22 @@ class TestVolumesClient(base.BaseServiceTest):
|
|||
'volume',
|
||||
'regionOne')
|
||||
|
||||
def _test_retype_volume(self, bytes_body=False):
|
||||
kwargs = {
|
||||
"new_type": "dedup-tier-replication",
|
||||
"migration_policy": "never"
|
||||
}
|
||||
|
||||
self.check_service_client_function(
|
||||
self.client.retype_volume,
|
||||
'tempest.lib.common.rest_client.RestClient.post',
|
||||
{},
|
||||
to_utf=bytes_body,
|
||||
status=202,
|
||||
volume_id="a3be971b-8de5-4bdf-bdb8-3d8eb0fb69f8",
|
||||
**kwargs
|
||||
)
|
||||
|
||||
def _test_force_detach_volume(self, bytes_body=False):
|
||||
kwargs = {
|
||||
'attachment_id': '6980e295-920f-412e-b189-05c50d605acd',
|
||||
|
@ -71,3 +87,9 @@ class TestVolumesClient(base.BaseServiceTest):
|
|||
|
||||
def test_show_volume_metadata_item_with_bytes_body(self):
|
||||
self._test_show_volume_metadata_item(bytes_body=True)
|
||||
|
||||
def test_retype_volume_with_str_body(self):
|
||||
self._test_retype_volume()
|
||||
|
||||
def test_retype_volume_with_bytes_body(self):
|
||||
self._test_retype_volume(bytes_body=True)
|
||||
|
|
Loading…
Reference in New Issue