diff --git a/jenkins_pipelines/scripts/SUSEManager_cleaner/suse_manager_cleaner_program/suse_manager_api.py b/jenkins_pipelines/scripts/SUSEManager_cleaner/suse_manager_cleaner_program/suse_manager_api.py index ebd2e780c..22e72ecd2 100644 --- a/jenkins_pipelines/scripts/SUSEManager_cleaner/suse_manager_cleaner_program/suse_manager_api.py +++ b/jenkins_pipelines/scripts/SUSEManager_cleaner/suse_manager_cleaner_program/suse_manager_api.py @@ -55,7 +55,7 @@ def delete_software_channels(self): if "custom" in channel['label'] and not any(protected in channel['label'] for protected in self.resources_to_delete): logger.info(f"Delete custom channel: {channel['label']}") self.client.channel.software.delete(self.session_key, channel['label']) - logging.warning("Delete only custom channels for uyuni.") + logging.warning("Delete only custom channels for uyuni") return for channel in channels: diff --git a/jenkins_pipelines/scripts/SUSEManager_cleaner/tests/test_suse_manager_api.py b/jenkins_pipelines/scripts/SUSEManager_cleaner/tests/test_suse_manager_api.py index c851e95dd..9b2bf6a46 100644 --- a/jenkins_pipelines/scripts/SUSEManager_cleaner/tests/test_suse_manager_api.py +++ b/jenkins_pipelines/scripts/SUSEManager_cleaner/tests/test_suse_manager_api.py @@ -86,7 +86,7 @@ def test_delete_channel_repos(self): self.mock_client.channel.software.removeRepo.assert_any_call("mock_session_key", "repo1") self.mock_client.channel.software.removeRepo.assert_any_call("mock_session_key", "repo2") - def test_delete_software_channels_skipped_for_uyuni(self): + def test_delete_software_channels_warning_for_uyuni(self): # Set the product_version to "uyuni" to simulate Uyuni environment self.resource_manager.product_version = "uyuni" @@ -94,10 +94,7 @@ def test_delete_software_channels_skipped_for_uyuni(self): with patch('logging.warning') as mock_warning: self.resource_manager.delete_software_channels() # Check if the warning message was logged - mock_warning.assert_called_once_with("Delete channels not supported for uyuni") - - # Ensure no deletion calls were made - self.mock_client.channel.software.delete.assert_not_called() + mock_warning.assert_called_once_with("Delete only custom channels for uyuni") def test_delete_salt_keys(self): self.mock_client.saltkey.acceptedList.return_value = [