diff --git a/manila/share/drivers/netapp/dataontap/client/client_cmode.py b/manila/share/drivers/netapp/dataontap/client/client_cmode.py index d02e05453a..7736fcdf8b 100644 --- a/manila/share/drivers/netapp/dataontap/client/client_cmode.py +++ b/manila/share/drivers/netapp/dataontap/client/client_cmode.py @@ -3770,6 +3770,8 @@ class NetAppCmodeClient(client_base.NetAppBaseClient): @na_utils.trace def qos_policy_group_rename(self, qos_policy_group_name, new_name): """Renames a QoS policy group.""" + if qos_policy_group_name == new_name: + return api_args = { 'policy-group-name': qos_policy_group_name, 'new-name': new_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 c2bc5f89c1..6405c42a4f 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 @@ -6415,6 +6415,15 @@ class NetAppClientCmodeTestCase(test.TestCase): self.client.send_request.assert_called_once_with( 'qos-policy-group-rename', qos_policy_group_rename_args, False) + def test_qos_policy_group_rename_noop(self): + self.mock_object(self.client, 'send_request') + + # rename to same name = no-op + self.client.qos_policy_group_rename( + fake.QOS_POLICY_GROUP_NAME, fake.QOS_POLICY_GROUP_NAME) + + self.assertFalse(self.client.send_request.called) + def test_mark_qos_policy_group_for_deletion_rename_failure(self): self.mock_object(self.client, 'qos_policy_group_exists', mock.Mock(return_value=True))