From 7d1a66632ea4f1ed519a0a318a97e7444f225c19 Mon Sep 17 00:00:00 2001 From: Felipe Rodrigues Date: Thu, 21 Sep 2023 08:03:47 -0300 Subject: [PATCH] [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 --- .../netapp/dataontap/client/client_cmode.py | 8 +++---- .../dataontap/client/test_client_cmode.py | 21 +++++++------------ ...up-dedup-compression-aeb013a6ef24f610.yaml | 6 ++++++ 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 releasenotes/notes/bug-2036931-fix-flexgroup-dedup-compression-aeb013a6ef24f610.yaml diff --git a/manila/share/drivers/netapp/dataontap/client/client_cmode.py b/manila/share/drivers/netapp/dataontap/client/client_cmode.py index 5200f442b7..343eece21e 100644 --- a/manila/share/drivers/netapp/dataontap/client/client_cmode.py +++ b/manila/share/drivers/netapp/dataontap/client/client_cmode.py @@ -2394,13 +2394,13 @@ class NetAppCmodeClient(client_base.NetAppBaseClient): def enable_dedupe_async(self, volume_name): """Enable deduplication on FlexVol/FlexGroup volume asynchronously.""" 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 def disable_dedupe_async(self, volume_name): """Disable deduplication on FlexVol/FlexGroup volume asynchronously.""" 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 def enable_compression_async(self, volume_name): @@ -2409,7 +2409,7 @@ class NetAppCmodeClient(client_base.NetAppBaseClient): 'volume-name': volume_name, '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 def disable_compression_async(self, volume_name): @@ -2418,7 +2418,7 @@ class NetAppCmodeClient(client_base.NetAppBaseClient): 'volume-name': volume_name, '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 def get_volume_efficiency_status(self, volume_name): diff --git a/manila/tests/share/drivers/netapp/dataontap/client/test_client_cmode.py b/manila/tests/share/drivers/netapp/dataontap/client/test_client_cmode.py index ed5832af61..5ad6edb50f 100644 --- a/manila/tests/share/drivers/netapp/dataontap/client/test_client_cmode.py +++ b/manila/tests/share/drivers/netapp/dataontap/client/test_client_cmode.py @@ -3583,28 +3583,25 @@ class NetAppClientCmodeTestCase(test.TestCase): sis_set_config_args) 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) sis_enable_args = {'volume-name': fake.SHARE_NAME} - - self.client.connection.send_request.assert_called_once_with( + self.client.send_request.assert_called_once_with( 'sis-enable-async', sis_enable_args) def test_disable_dedupe_async(self): - - self.mock_object(self.client.connection, 'send_request') + self.mock_object(self.client, 'send_request') self.client.disable_dedupe_async(fake.SHARE_NAME) sis_enable_args = {'volume-name': fake.SHARE_NAME} - - self.client.connection.send_request.assert_called_once_with( + self.client.send_request.assert_called_once_with( 'sis-disable-async', sis_enable_args) 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) @@ -3612,12 +3609,11 @@ class NetAppClientCmodeTestCase(test.TestCase): 'volume-name': fake.SHARE_NAME, 'enable-compression': 'true' } - - self.client.connection.send_request.assert_called_once_with( + self.client.send_request.assert_called_once_with( 'sis-set-config-async', sis_set_config_args) 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) @@ -3625,8 +3621,7 @@ class NetAppClientCmodeTestCase(test.TestCase): 'volume-name': fake.SHARE_NAME, 'enable-compression': 'false' } - - self.client.connection.send_request.assert_called_once_with( + self.client.send_request.assert_called_once_with( 'sis-set-config-async', sis_set_config_args) def test_get_volume_efficiency_status(self): diff --git a/releasenotes/notes/bug-2036931-fix-flexgroup-dedup-compression-aeb013a6ef24f610.yaml b/releasenotes/notes/bug-2036931-fix-flexgroup-dedup-compression-aeb013a6ef24f610.yaml new file mode 100644 index 0000000000..6bbe7c4380 --- /dev/null +++ b/releasenotes/notes/bug-2036931-fix-flexgroup-dedup-compression-aeb013a6ef24f610.yaml @@ -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 `