[NetApp] Fix FlexGroup share creation while configuring dedup/compression

FlexGroup shares cannot modify the dedup and compression fields,
since the client is wrongly used. This patch fix it by calling
the method correctly.

Closes-bug: #2036931
Change-Id: I57158d6e50e416b9acc2f2431fdbe903687649c4
This commit is contained in:
Felipe Rodrigues 2023-09-21 08:03:47 -03:00
parent 7de1b3afb1
commit 7d1a66632e
3 changed files with 18 additions and 17 deletions

View File

@ -2394,13 +2394,13 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
def enable_dedupe_async(self, volume_name): def enable_dedupe_async(self, volume_name):
"""Enable deduplication on FlexVol/FlexGroup volume asynchronously.""" """Enable deduplication on FlexVol/FlexGroup volume asynchronously."""
api_args = {'volume-name': volume_name} api_args = {'volume-name': volume_name}
self.connection.send_request('sis-enable-async', api_args) self.send_request('sis-enable-async', api_args)
@na_utils.trace @na_utils.trace
def disable_dedupe_async(self, volume_name): def disable_dedupe_async(self, volume_name):
"""Disable deduplication on FlexVol/FlexGroup volume asynchronously.""" """Disable deduplication on FlexVol/FlexGroup volume asynchronously."""
api_args = {'volume-name': volume_name} api_args = {'volume-name': volume_name}
self.connection.send_request('sis-disable-async', api_args) self.send_request('sis-disable-async', api_args)
@na_utils.trace @na_utils.trace
def enable_compression_async(self, volume_name): def enable_compression_async(self, volume_name):
@ -2409,7 +2409,7 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
'volume-name': volume_name, 'volume-name': volume_name,
'enable-compression': 'true' 'enable-compression': 'true'
} }
self.connection.send_request('sis-set-config-async', api_args) self.send_request('sis-set-config-async', api_args)
@na_utils.trace @na_utils.trace
def disable_compression_async(self, volume_name): def disable_compression_async(self, volume_name):
@ -2418,7 +2418,7 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
'volume-name': volume_name, 'volume-name': volume_name,
'enable-compression': 'false' 'enable-compression': 'false'
} }
self.connection.send_request('sis-set-config-async', api_args) self.send_request('sis-set-config-async', api_args)
@na_utils.trace @na_utils.trace
def get_volume_efficiency_status(self, volume_name): def get_volume_efficiency_status(self, volume_name):

View File

@ -3583,28 +3583,25 @@ class NetAppClientCmodeTestCase(test.TestCase):
sis_set_config_args) sis_set_config_args)
def test_enable_dedupe_async(self): def test_enable_dedupe_async(self):
self.mock_object(self.client.connection, 'send_request') self.mock_object(self.client, 'send_request')
self.client.enable_dedupe_async(fake.SHARE_NAME) self.client.enable_dedupe_async(fake.SHARE_NAME)
sis_enable_args = {'volume-name': fake.SHARE_NAME} sis_enable_args = {'volume-name': fake.SHARE_NAME}
self.client.send_request.assert_called_once_with(
self.client.connection.send_request.assert_called_once_with(
'sis-enable-async', sis_enable_args) 'sis-enable-async', sis_enable_args)
def test_disable_dedupe_async(self): def test_disable_dedupe_async(self):
self.mock_object(self.client, 'send_request')
self.mock_object(self.client.connection, 'send_request')
self.client.disable_dedupe_async(fake.SHARE_NAME) self.client.disable_dedupe_async(fake.SHARE_NAME)
sis_enable_args = {'volume-name': fake.SHARE_NAME} sis_enable_args = {'volume-name': fake.SHARE_NAME}
self.client.send_request.assert_called_once_with(
self.client.connection.send_request.assert_called_once_with(
'sis-disable-async', sis_enable_args) 'sis-disable-async', sis_enable_args)
def test_enable_compression_async(self): def test_enable_compression_async(self):
self.mock_object(self.client.connection, 'send_request') self.mock_object(self.client, 'send_request')
self.client.enable_compression_async(fake.SHARE_NAME) self.client.enable_compression_async(fake.SHARE_NAME)
@ -3612,12 +3609,11 @@ class NetAppClientCmodeTestCase(test.TestCase):
'volume-name': fake.SHARE_NAME, 'volume-name': fake.SHARE_NAME,
'enable-compression': 'true' 'enable-compression': 'true'
} }
self.client.send_request.assert_called_once_with(
self.client.connection.send_request.assert_called_once_with(
'sis-set-config-async', sis_set_config_args) 'sis-set-config-async', sis_set_config_args)
def test_disable_compression_async(self): def test_disable_compression_async(self):
self.mock_object(self.client.connection, 'send_request') self.mock_object(self.client, 'send_request')
self.client.disable_compression_async(fake.SHARE_NAME) self.client.disable_compression_async(fake.SHARE_NAME)
@ -3625,8 +3621,7 @@ class NetAppClientCmodeTestCase(test.TestCase):
'volume-name': fake.SHARE_NAME, 'volume-name': fake.SHARE_NAME,
'enable-compression': 'false' 'enable-compression': 'false'
} }
self.client.send_request.assert_called_once_with(
self.client.connection.send_request.assert_called_once_with(
'sis-set-config-async', sis_set_config_args) 'sis-set-config-async', sis_set_config_args)
def test_get_volume_efficiency_status(self): def test_get_volume_efficiency_status(self):

View File

@ -0,0 +1,6 @@
---
fixes:
- |
NetApp driver: fixed FlexGroup share creation while modifying the dedup
and compression configurations. For more details please refer to
`launchpad bug #2036931 <https://bugs.launchpad.net/manila/+bug/2036931>`