diff --git a/src/core/src/core_logic/ExecutionConfig.py b/src/core/src/core_logic/ExecutionConfig.py index 0f19ce1b..892adf7c 100644 --- a/src/core/src/core_logic/ExecutionConfig.py +++ b/src/core/src/core_logic/ExecutionConfig.py @@ -19,6 +19,8 @@ import json import os import uuid +from types import NoneType + from core.src.bootstrap.Constants import Constants @@ -117,6 +119,9 @@ def __get_max_patch_publish_date(self, health_store_id): def __get_max_patch_publish_date_from_inclusions(self, included_package_name_mask_list): # type (str) -> str # This is for AzGPS mitigation mode execution for Strict safe-deployment of patches. + if included_package_name_mask_list is None: + return str() + mitigation_mode_flag = False mitigation_mode_flag_pos = -1 candidate = str() diff --git a/src/core/tests/Test_AptitudePackageManager.py b/src/core/tests/Test_AptitudePackageManager.py index e7ea4999..a18436d6 100644 --- a/src/core/tests/Test_AptitudePackageManager.py +++ b/src/core/tests/Test_AptitudePackageManager.py @@ -631,6 +631,15 @@ def test_maxpatchpublishdate_mitigation_mode(self): self.assertEqual(len(execution_config.included_package_name_mask_list), 4) self.runtime.stop() + # no patches to include set (assessment) + argument_composer = ArgumentComposer() + argument_composer.patches_to_include = None + self.runtime = RuntimeCompositor(argument_composer.get_composed_arguments(), True, Constants.APT) + execution_config = self.runtime.container.get('execution_config') + self.assertEqual(execution_config.max_patch_publish_date, "") + self.assertEqual(execution_config.included_package_name_mask_list, None) + self.runtime.stop() + def test_eula_acceptance_file_read_success(self): self.runtime.stop()