diff --git a/convert2rhel/actions/system_checks/els.py b/convert2rhel/actions/system_checks/els.py index 7a0dcc614f..6cfe4b9902 100644 --- a/convert2rhel/actions/system_checks/els.py +++ b/convert2rhel/actions/system_checks/els.py @@ -19,12 +19,14 @@ import logging from convert2rhel import actions -from convert2rhel.systeminfo import ELS_START_DATE, system_info +from convert2rhel.systeminfo import system_info from convert2rhel.toolopts import tool_opts logger = logging.getLogger(__name__) +ELS_START_DATE = "2024-07-01" + class ElsSystemCheck(actions.Action): id = "ELS_SYSTEM_CHECK" @@ -38,6 +40,7 @@ def run(self): # Turn ELS_START_DATE into a datetime object els_start_date = datetime.datetime.strptime(ELS_START_DATE, "%Y-%m-%d").date() + print(current_datetime > els_start_date) # warning message if the els release date is past and the --els option is not set if not tool_opts.els and current_datetime > els_start_date: self.add_message( diff --git a/convert2rhel/systeminfo.py b/convert2rhel/systeminfo.py index f37facf356..876b4c4efe 100644 --- a/convert2rhel/systeminfo.py +++ b/convert2rhel/systeminfo.py @@ -62,8 +62,6 @@ # Dictionary of EUS minor versions supported and their EUS period start date EUS_MINOR_VERSIONS = {"8.8": "2023-11-14"} -ELS_START_DATE = "2024-07-01" - Version = namedtuple("Version", ["major", "minor"]) diff --git a/convert2rhel/unit_tests/actions/system_checks/els_test.py b/convert2rhel/unit_tests/actions/system_checks/els_test.py index 0a75e07d30..67a7b3bd40 100644 --- a/convert2rhel/unit_tests/actions/system_checks/els_test.py +++ b/convert2rhel/unit_tests/actions/system_checks/els_test.py @@ -32,7 +32,7 @@ def els_action(): class DateMock(datetime.date): @classmethod def today(cls): - return cls(2024, 6, 13) + return cls(2024, 7, 2) class TestEus: @@ -58,8 +58,11 @@ def test_els_warning_message(self, els_action, monkeypatch, global_tool_opts, ve level="WARNING", id="ELS_COMMAND_LINE_OPTION_UNUSED", title="The --els command line option is unused", - description="Current system version is under Extended Lifecycle Support (ELS). You may want to consider using the --els" - " command line option to land on a system patched with the latest security errata.", + description=( + "Current system version is under Extended Lifecycle Support (ELS). You may want to " + "consider using the --els command line option to land on a system patched with the latest " + "security errata.", + ), ), ) )