Send resize parameters in rpc as list in the Quobyte driver

Corrects backend RPC parameter formatting for extend and shrink commands.
Removes a Note regarding share resizing that has become superfluous
due to the upcoming Quobyte 1.4 release.

Closes-Bug: #1666541

Change-Id: Ifa9223c9ad87f7b030433a04e7e76c9d64278463
This commit is contained in:
Silvan Kaiser 2017-02-23 17:12:02 +01:00
parent 9c6836912c
commit b3502c94d7
3 changed files with 20 additions and 13 deletions

View File

@ -178,10 +178,13 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
return project_id return project_id
def _resize_share(self, share, new_size): def _resize_share(self, share, new_size):
# TODO(kaisers): check and update existing quota if already present self.rpc.call('setQuota', {"quotas": [
self.rpc.call('setQuota', {"consumer": {"type": 3, {"consumer":
"identifier": share["name"]}, [{"type": "VOLUME",
"limits": {"type": 5, "value": new_size}}) "identifier": share["name"]}],
"limits": [{"type": "LOGICAL_DISK_SPACE",
"value": new_size}]}
]})
def _resolve_volume_name(self, volume_name, tenant_domain): def _resolve_volume_name(self, volume_name, tenant_domain):
"""Resolve a volume name to the global volume uuid.""" """Resolve a volume name to the global volume uuid."""

View File

@ -394,15 +394,16 @@ class QuobyteShareDriverTestCase(test.TestCase):
self._driver._resize_share(share=self.share, new_size=7) self._driver._resize_share(share=self.share, new_size=7)
exp_params = { exp_params = {
"consumer": { "quotas": [{
"type": 3, "consumer": [{
"type": "VOLUME",
"identifier": self.share["name"], "identifier": self.share["name"],
}, }],
"limits": { "limits": [{
"type": 5, "type": "LOGICAL_DISK_SPACE",
"value": 7, "value": 7,
}, }],
} }]}
self._driver.rpc.call.assert_has_calls([ self._driver.rpc.call.assert_has_calls([
mock.call('setQuota', exp_params)]) mock.call('setQuota', exp_params)])

View File

@ -0,0 +1,3 @@
---
fixes:
- Quobyte share extend/shrink operations now work with all Quobyte API versions