Make delete_volume in volumes_client.py use **params
I99f9910f75aef095f2bbb37680ee584e52bf82da introduced a new kwarg to the delete_volume() method. But the correct way to do this is to introduce a generic **params argument, so avoid changing the signature of the method too often. Change-Id: Ifb6731fd893a32bea6c7832236bb26a2eacaf56c
This commit is contained in:
parent
8bf816a7fb
commit
cb5f650fd4
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``delete_volume`` method of the ``VolumesClient`` class
|
||||||
|
now has an additional ``**params`` argument that enables passing
|
||||||
|
additional information in the query string of the HTTP request.
|
||||||
|
|
@ -118,11 +118,16 @@ class VolumesClient(rest_client.RestClient):
|
|||||||
self.expected_success(200, resp.status)
|
self.expected_success(200, resp.status)
|
||||||
return rest_client.ResponseBody(resp, body)
|
return rest_client.ResponseBody(resp, body)
|
||||||
|
|
||||||
def delete_volume(self, volume_id, cascade=False):
|
def delete_volume(self, volume_id, **params):
|
||||||
"""Deletes the Specified Volume."""
|
"""Deletes the Specified Volume.
|
||||||
|
|
||||||
|
For a full list of available parameters, please refer to the official
|
||||||
|
API reference:
|
||||||
|
https://developer.openstack.org/api-ref/block-storage/v2/#delete-volume
|
||||||
|
"""
|
||||||
url = 'volumes/%s' % volume_id
|
url = 'volumes/%s' % volume_id
|
||||||
if cascade:
|
if params:
|
||||||
url += '?cascade=True'
|
url += '?%s' % urllib.urlencode(params)
|
||||||
resp, body = self.delete(url)
|
resp, body = self.delete(url)
|
||||||
self.expected_success(202, resp.status)
|
self.expected_success(202, resp.status)
|
||||||
return rest_client.ResponseBody(resp, body)
|
return rest_client.ResponseBody(resp, body)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user