diff --git a/manila/share/drivers/quobyte/quobyte.py b/manila/share/drivers/quobyte/quobyte.py index 34a3158ec4..051c8b0934 100644 --- a/manila/share/drivers/quobyte/quobyte.py +++ b/manila/share/drivers/quobyte/quobyte.py @@ -178,10 +178,13 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,): return project_id def _resize_share(self, share, new_size): - # TODO(kaisers): check and update existing quota if already present - self.rpc.call('setQuota', {"consumer": {"type": 3, - "identifier": share["name"]}, - "limits": {"type": 5, "value": new_size}}) + self.rpc.call('setQuota', {"quotas": [ + {"consumer": + [{"type": "VOLUME", + "identifier": share["name"]}], + "limits": [{"type": "LOGICAL_DISK_SPACE", + "value": new_size}]} + ]}) def _resolve_volume_name(self, volume_name, tenant_domain): """Resolve a volume name to the global volume uuid.""" diff --git a/manila/tests/share/drivers/quobyte/test_quobyte.py b/manila/tests/share/drivers/quobyte/test_quobyte.py index c43cb2f5dd..8a04da8075 100644 --- a/manila/tests/share/drivers/quobyte/test_quobyte.py +++ b/manila/tests/share/drivers/quobyte/test_quobyte.py @@ -394,15 +394,16 @@ class QuobyteShareDriverTestCase(test.TestCase): self._driver._resize_share(share=self.share, new_size=7) exp_params = { - "consumer": { - "type": 3, - "identifier": self.share["name"], - }, - "limits": { - "type": 5, - "value": 7, - }, - } + "quotas": [{ + "consumer": [{ + "type": "VOLUME", + "identifier": self.share["name"], + }], + "limits": [{ + "type": "LOGICAL_DISK_SPACE", + "value": 7, + }], + }]} self._driver.rpc.call.assert_has_calls([ mock.call('setQuota', exp_params)]) diff --git a/releasenotes/notes/bug-1666541-quobyte-resize-list-param-bc5b9c42bdc94c9f.yaml b/releasenotes/notes/bug-1666541-quobyte-resize-list-param-bc5b9c42bdc94c9f.yaml new file mode 100644 index 0000000000..3497ba4e04 --- /dev/null +++ b/releasenotes/notes/bug-1666541-quobyte-resize-list-param-bc5b9c42bdc94c9f.yaml @@ -0,0 +1,3 @@ +--- +fixes: + - Quobyte share extend/shrink operations now work with all Quobyte API versions