Compare commits
No commits in common. "c8" and "c8-beta" have entirely different histories.
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
SOURCES/deps-pkgs-13.tar.gz
|
||||
SOURCES/leapp-repository-0.23.0.tar.gz
|
||||
SOURCES/deps-pkgs-10.tar.gz
|
||||
SOURCES/leapp-repository-0.20.0.tar.gz
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
3590b33b4a79ebe62f5cfa0eeca7efb41d526498 SOURCES/deps-pkgs-13.tar.gz
|
||||
b5b541cc0c0372ee476f0ab6073a62e67290d031 SOURCES/leapp-repository-0.23.0.tar.gz
|
||||
d520ada12294e4dd8837c81f92d4c184ab403d51 SOURCES/deps-pkgs-10.tar.gz
|
||||
185bbb040dba48e1ea2d6c627133af594378afd4 SOURCES/leapp-repository-0.20.0.tar.gz
|
||||
|
||||
@ -1,333 +0,0 @@
|
||||
From dcf53c28ea9c3fdd03277abcdeb1d124660f7f8e Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 19 Aug 2025 09:48:11 +0200
|
||||
Subject: [PATCH 01/55] Add upgrade inhibitor for custom DNF pluginpath
|
||||
configuration
|
||||
|
||||
Implements detection and inhibition of the upgrade when DNF
|
||||
pluginpath is configured in /etc/dnf/dnf.conf:
|
||||
- Add DnfPluginPathDetected model to communicate detection results
|
||||
- Add ScanDnfPluginPath actor (FactsPhase) to scan DNF configuration
|
||||
- Add CheckDnfPluginPath actor (ChecksPhase) to create inhibitor report
|
||||
- Add related unit tests
|
||||
|
||||
Localisation of dnf plugins is not constant between system releases
|
||||
which can cause issues with the upgrade, so the user should remove
|
||||
this option or comment it out.
|
||||
|
||||
Jira: RHEL-69601
|
||||
---
|
||||
.../common/actors/checkdnfpluginpath/actor.py | 22 ++++++++
|
||||
.../libraries/checkdnfpluginpath.py | 35 ++++++++++++
|
||||
.../tests/test_checkdnfpluginpath.py | 34 ++++++++++++
|
||||
.../common/actors/scandnfpluginpath/actor.py | 21 ++++++++
|
||||
.../libraries/scandnfpluginpath.py | 30 +++++++++++
|
||||
.../files/dnf_config_incorrect_pluginpath | 7 +++
|
||||
.../tests/files/dnf_config_no_pluginpath | 6 +++
|
||||
.../tests/files/dnf_config_with_pluginpath | 7 +++
|
||||
.../tests/test_scandnfpluginpath.py | 53 +++++++++++++++++++
|
||||
.../common/models/dnfpluginpathdetected.py | 14 +++++
|
||||
10 files changed, 229 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..34055886
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
@@ -0,0 +1,22 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.checkdnfpluginpath import perform_check
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class CheckDnfPluginPath(Actor):
|
||||
+ """
|
||||
+ Inhibits the upgrade if a custom DNF plugin path is configured.
|
||||
+
|
||||
+ This actor checks whether the pluginpath option is configured in /etc/dnf/dnf.conf and produces a report if it is.
|
||||
+ If the option is detected with any value, the upgrade is inhibited.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_dnf_pluginpath'
|
||||
+ consumes = (DnfPluginPathDetected,)
|
||||
+ produces = (Report,)
|
||||
+ tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ perform_check()
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..ce705361
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
@@ -0,0 +1,35 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+DNF_CONFIG_PATH = '/etc/dnf/dnf.conf'
|
||||
+
|
||||
+
|
||||
+def check_dnf_pluginpath(dnf_pluginpath_detected):
|
||||
+ """Create an inhibitor when pluginpath is detected in DNF configuration."""
|
||||
+ if not dnf_pluginpath_detected.is_pluginpath_detected:
|
||||
+ return
|
||||
+ reporting.create_report([
|
||||
+ reporting.Title('Detected specified pluginpath in DNF configuration.'),
|
||||
+ reporting.Summary(
|
||||
+ 'The "pluginpath" option is set in the {} file. The path to DNF plugins differs between '
|
||||
+ 'system major releases due to different versions of Python. '
|
||||
+ 'This breaks the in-place upgrades if defined explicitly as DNF plugins '
|
||||
+ 'are stored on a different path on the new system.'
|
||||
+ .format(DNF_CONFIG_PATH)
|
||||
+ ),
|
||||
+ reporting.Remediation(
|
||||
+ hint='Remove or comment out the pluginpath option in the DNF '
|
||||
+ 'configuration file to be able to upgrade the system',
|
||||
+ commands=[['sed', '-i', '\'s/^pluginpath[[:space:]]*=/#pluginpath=/\'', DNF_CONFIG_PATH]],
|
||||
+ ),
|
||||
+ reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
+ reporting.RelatedResource('file', DNF_CONFIG_PATH),
|
||||
+ ])
|
||||
+
|
||||
+
|
||||
+def perform_check():
|
||||
+ dnf_pluginpath_detected = next(api.consume(DnfPluginPathDetected), None)
|
||||
+ if dnf_pluginpath_detected:
|
||||
+ check_dnf_pluginpath(dnf_pluginpath_detected)
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..7dd8bbf2
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
@@ -0,0 +1,34 @@
|
||||
+import pytest
|
||||
+
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.actor.checkdnfpluginpath import check_dnf_pluginpath, perform_check
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.utils.report import is_inhibitor
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('is_detected', [False, True])
|
||||
+def test_check_dnf_pluginpath(monkeypatch, is_detected):
|
||||
+ actor_reports = create_report_mocked()
|
||||
+ msg = DnfPluginPathDetected(is_pluginpath_detected=is_detected)
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[msg]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', actor_reports)
|
||||
+
|
||||
+ perform_check()
|
||||
+
|
||||
+ assert bool(actor_reports.called) == is_detected
|
||||
+
|
||||
+ if is_detected:
|
||||
+ assert is_inhibitor(actor_reports.report_fields)
|
||||
+
|
||||
+
|
||||
+def test_perform_check_no_message_available(monkeypatch):
|
||||
+ """Test perform_check when no DnfPluginPathDetected message is available."""
|
||||
+ actor_reports = create_report_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(reporting, 'create_report', actor_reports)
|
||||
+
|
||||
+ perform_check()
|
||||
+
|
||||
+ assert not actor_reports.called
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py b/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..e43a691e
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.scandnfpluginpath import scan_dnf_pluginpath
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class ScanDnfPluginPath(Actor):
|
||||
+ """
|
||||
+ Scans DNF configuration for custom pluginpath option.
|
||||
+
|
||||
+ This actor collects information about whether the pluginpath option is configured in DNF configuration
|
||||
+ and produces a DnfPluginPathDetected message, containing the information.
|
||||
+ """
|
||||
+
|
||||
+ name = 'scan_dnf_pluginpath'
|
||||
+ consumes = ()
|
||||
+ produces = (DnfPluginPathDetected,)
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ scan_dnf_pluginpath()
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py b/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..818f7700
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
@@ -0,0 +1,30 @@
|
||||
+import os
|
||||
+
|
||||
+from six.moves import configparser
|
||||
+
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+DNF_CONFIG_PATH = '/etc/dnf/dnf.conf'
|
||||
+
|
||||
+
|
||||
+def _is_pluginpath_set(config_path):
|
||||
+ """Check if pluginpath option is set in DNF configuration file."""
|
||||
+ if not os.path.isfile(config_path):
|
||||
+ api.current_logger().warning('The %s file is missing.', config_path)
|
||||
+ return False
|
||||
+
|
||||
+ parser = configparser.ConfigParser()
|
||||
+
|
||||
+ try:
|
||||
+ parser.read(config_path)
|
||||
+ return parser.has_option('main', 'pluginpath')
|
||||
+ except (configparser.Error, IOError) as e:
|
||||
+ api.current_logger().warning('The DNF config file %s couldn\'t be parsed: %s', config_path, e)
|
||||
+ return False
|
||||
+
|
||||
+
|
||||
+def scan_dnf_pluginpath():
|
||||
+ """Scan DNF configuration and produce DnfPluginPathDetected message."""
|
||||
+ is_detected = _is_pluginpath_set(DNF_CONFIG_PATH)
|
||||
+ api.produce(DnfPluginPathDetected(is_pluginpath_detected=is_detected))
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..aa29db09
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
@@ -0,0 +1,7 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
+pluginpathincorrect=/usr/lib/python3.6/site-packages/dnf-plugins
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..3d08d075
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
@@ -0,0 +1,6 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..09a81e64
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
@@ -0,0 +1,7 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
+pluginpath=/usr/lib/python3.6/site-packages/dnf-plugins
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..fefb9d3f
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
@@ -0,0 +1,53 @@
|
||||
+import os
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import scandnfpluginpath
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('is_detected', [False, True])
|
||||
+def test_scan_detects_pluginpath(monkeypatch, is_detected):
|
||||
+ mocked_producer = produce_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(api, 'produce', mocked_producer)
|
||||
+
|
||||
+ monkeypatch.setattr(scandnfpluginpath, '_is_pluginpath_set',
|
||||
+ lambda path: is_detected)
|
||||
+
|
||||
+ scandnfpluginpath.scan_dnf_pluginpath()
|
||||
+
|
||||
+ assert mocked_producer.called == 1
|
||||
+ assert mocked_producer.model_instances[0].is_pluginpath_detected is is_detected
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(('config_file', 'result'), [
|
||||
+ ('files/dnf_config_no_pluginpath', False),
|
||||
+ ('files/dnf_config_with_pluginpath', True),
|
||||
+ ('files/dnf_config_incorrect_pluginpath', False),
|
||||
+ ('files/not_existing_file.conf', False)
|
||||
+])
|
||||
+def test_is_pluginpath_set(config_file, result):
|
||||
+ CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
+
|
||||
+ assert scandnfpluginpath._is_pluginpath_set(os.path.join(CUR_DIR, config_file)) == result
|
||||
+
|
||||
+
|
||||
+def test_scan_no_config_file(monkeypatch):
|
||||
+ mocked_producer = produce_mocked()
|
||||
+ logger = logger_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(api, 'produce', mocked_producer)
|
||||
+ monkeypatch.setattr(api, 'current_logger', lambda: logger)
|
||||
+
|
||||
+ filename = 'files/not_existing_file.conf'
|
||||
+ monkeypatch.setattr(scandnfpluginpath, 'DNF_CONFIG_PATH', filename)
|
||||
+ scandnfpluginpath.scan_dnf_pluginpath()
|
||||
+
|
||||
+ assert mocked_producer.called == 1
|
||||
+ assert mocked_producer.model_instances[0].is_pluginpath_detected is False
|
||||
+
|
||||
+ assert 'The %s file is missing.' in logger.warnmsg
|
||||
+ assert filename in logger.warnmsg
|
||||
diff --git a/repos/system_upgrade/common/models/dnfpluginpathdetected.py b/repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
new file mode 100644
|
||||
index 00000000..c5474857
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
@@ -0,0 +1,14 @@
|
||||
+from leapp.models import fields, Model
|
||||
+from leapp.topics import SystemInfoTopic
|
||||
+
|
||||
+
|
||||
+class DnfPluginPathDetected(Model):
|
||||
+ """
|
||||
+ This model contains information about whether DNF pluginpath option is configured in /etc/dnf/dnf.conf.
|
||||
+ """
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ is_pluginpath_detected = fields.Boolean()
|
||||
+ """
|
||||
+ True if pluginpath option is found in /etc/dnf/dnf.conf, False otherwise.
|
||||
+ """
|
||||
--
|
||||
2.51.1
|
||||
|
||||
251
SOURCES/0001-rhui-do-not-bootstrap-target-client-on-aws.patch
Normal file
251
SOURCES/0001-rhui-do-not-bootstrap-target-client-on-aws.patch
Normal file
@ -0,0 +1,251 @@
|
||||
From 921c06892f7550a3a8e2b3fe941c6272bdacf88d Mon Sep 17 00:00:00 2001
|
||||
From: mhecko <mhecko@redhat.com>
|
||||
Date: Thu, 15 Feb 2024 09:56:27 +0100
|
||||
Subject: [PATCH] rhui: do not bootstrap target client on aws
|
||||
|
||||
Bootstrapping target RHUI client now requires installing the entire
|
||||
RHEL8 RPM stack. Threfore, do not try installing target client
|
||||
and instead rely only on the files from our leapp-rhui-aws package.
|
||||
---
|
||||
.../cloud/checkrhui/libraries/checkrhui.py | 6 +-
|
||||
.../libraries/userspacegen.py | 104 ++++++++++++++----
|
||||
.../system_upgrade/common/models/rhuiinfo.py | 7 ++
|
||||
3 files changed, 92 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
index 84ab40e3..e1c158c7 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
@@ -142,7 +142,11 @@ def customize_rhui_setup_for_aws(rhui_family, setup_info):
|
||||
|
||||
target_version = version.get_target_major_version()
|
||||
if target_version == '8':
|
||||
- return # The rhel8 plugin is packed into leapp-rhui-aws as we need python2 compatible client
|
||||
+ # RHEL8 rh-amazon-rhui-client depends on amazon-libdnf-plugin that depends
|
||||
+ # essentially on the entire RHEL8 RPM stack, so we cannot just swap the clients
|
||||
+ # The leapp-rhui-aws will provide all necessary files to access entire RHEL8 content
|
||||
+ setup_info.bootstrap_target_client = False
|
||||
+ return
|
||||
|
||||
amazon_plugin_copy_task = CopyFile(src='/usr/lib/python3.9/site-packages/dnf-plugins/amazon-id.py',
|
||||
dst='/usr/lib/python3.6/site-packages/dnf-plugins/')
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index d917bfd5..d60bc75f 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -853,9 +853,9 @@ def _get_rhui_available_repoids(context, cloud_repo):
|
||||
return set(repoids)
|
||||
|
||||
|
||||
-def get_copy_location_from_copy_in_task(context, copy_task):
|
||||
+def get_copy_location_from_copy_in_task(context_basepath, copy_task):
|
||||
basename = os.path.basename(copy_task.src)
|
||||
- dest_in_container = context.full_path(copy_task.dst)
|
||||
+ dest_in_container = os.path.join(context_basepath, copy_task.dst)
|
||||
if os.path.isdir(dest_in_container):
|
||||
return os.path.join(copy_task.dst, basename)
|
||||
return copy_task.dst
|
||||
@@ -871,7 +871,10 @@ def _get_rh_available_repoids(context, indata):
|
||||
|
||||
# If we are upgrading a RHUI system, check what repositories are provided by the (already installed) target clients
|
||||
if indata and indata.rhui_info:
|
||||
- files_provided_by_clients = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
+ setup_info = indata.rhui_info.target_client_setup_info
|
||||
+ target_content_access_files = set()
|
||||
+ if setup_info.bootstrap_target_client:
|
||||
+ target_content_access_files = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
|
||||
def is_repofile(path):
|
||||
return os.path.dirname(path) == '/etc/yum.repos.d' and os.path.basename(path).endswith('.repo')
|
||||
@@ -884,24 +887,33 @@ def _get_rh_available_repoids(context, indata):
|
||||
|
||||
yum_repos_d = context.full_path('/etc/yum.repos.d')
|
||||
all_repofiles = {os.path.join(yum_repos_d, path) for path in os.listdir(yum_repos_d) if path.endswith('.repo')}
|
||||
- client_repofiles = {context.full_path(path) for path in files_provided_by_clients if is_repofile(path)}
|
||||
+ api.current_logger().debug('(RHUI Setup) All available repofiles: {0}'.format(' '.join(all_repofiles)))
|
||||
+
|
||||
+ target_access_repofiles = {
|
||||
+ context.full_path(path) for path in target_content_access_files if is_repofile(path)
|
||||
+ }
|
||||
|
||||
# Exclude repofiles used to setup the target rhui access as on some platforms the repos provided by
|
||||
# the client are not sufficient to install the client into target userspace (GCP)
|
||||
rhui_setup_repofile_tasks = [task for task in setup_tasks if task.src.endswith('repo')]
|
||||
rhui_setup_repofiles = (
|
||||
- get_copy_location_from_copy_in_task(context, copy_task) for copy_task in rhui_setup_repofile_tasks
|
||||
+ get_copy_location_from_copy_in_task(context.base_dir, copy) for copy in rhui_setup_repofile_tasks
|
||||
)
|
||||
rhui_setup_repofiles = {context.full_path(repofile) for repofile in rhui_setup_repofiles}
|
||||
|
||||
- foreign_repofiles = all_repofiles - client_repofiles - rhui_setup_repofiles
|
||||
+ foreign_repofiles = all_repofiles - target_access_repofiles - rhui_setup_repofiles
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'The following repofiles are considered as unknown to'
|
||||
+ ' the target RHUI content setup and will be ignored: {0}'.format(' '.join(foreign_repofiles))
|
||||
+ )
|
||||
|
||||
# Rename non-client repofiles so they will not be recognized when running dnf repolist
|
||||
for foreign_repofile in foreign_repofiles:
|
||||
os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile))
|
||||
|
||||
try:
|
||||
- dnf_cmd = ['dnf', 'repolist', '--releasever', target_ver, '-v']
|
||||
+ dnf_cmd = ['dnf', 'repolist', '--releasever', target_ver, '-v', '--enablerepo', '*']
|
||||
repolist_result = context.call(dnf_cmd)['stdout']
|
||||
repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')]
|
||||
rhui_repoids = {extract_repoid_from_line(line) for line in repoid_lines}
|
||||
@@ -919,6 +931,9 @@ def _get_rh_available_repoids(context, indata):
|
||||
for foreign_repofile in foreign_repofiles:
|
||||
os.rename('{0}.back'.format(foreign_repofile), foreign_repofile)
|
||||
|
||||
+ api.current_logger().debug(
|
||||
+ 'The following repofiles are considered as provided by RedHat: {0}'.format(' '.join(rh_repoids))
|
||||
+ )
|
||||
return rh_repoids
|
||||
|
||||
|
||||
@@ -1086,7 +1101,7 @@ def _get_target_userspace():
|
||||
return constants.TARGET_USERSPACE.format(get_target_major_version())
|
||||
|
||||
|
||||
-def _create_target_userspace(context, packages, files, target_repoids):
|
||||
+def _create_target_userspace(context, indata, packages, files, target_repoids):
|
||||
"""Create the target userspace."""
|
||||
target_path = _get_target_userspace()
|
||||
prepare_target_userspace(context, target_path, target_repoids, list(packages))
|
||||
@@ -1096,12 +1111,57 @@ def _create_target_userspace(context, packages, files, target_repoids):
|
||||
_copy_files(target_context, files)
|
||||
dnfplugin.install(_get_target_userspace())
|
||||
|
||||
+ # If we used only repofiles from leapp-rhui-<provider> then remove these as they provide
|
||||
+ # duplicit definitions as the target clients already installed in the target container
|
||||
+ if indata.rhui_info:
|
||||
+ api.current_logger().debug(
|
||||
+ 'Target container should have access to content. '
|
||||
+ 'Removing repofiles from leapp-rhui-<provider> from the target..'
|
||||
+ )
|
||||
+ setup_info = indata.rhui_info.target_client_setup_info
|
||||
+ if not setup_info.bootstrap_target_client:
|
||||
+ target_userspace_path = _get_target_userspace()
|
||||
+ for copy in setup_info.preinstall_tasks.files_to_copy_into_overlay:
|
||||
+ dst_in_container = get_copy_location_from_copy_in_task(target_userspace_path, copy)
|
||||
+ dst_in_container = dst_in_container.strip('/')
|
||||
+ dst_in_host = os.path.join(target_userspace_path, dst_in_container)
|
||||
+ if os.path.isfile(dst_in_host) and dst_in_host.endswith('.repo'):
|
||||
+ api.current_logger().debug('Removing repofile: {0}'.format(dst_in_host))
|
||||
+ os.remove(dst_in_host)
|
||||
+
|
||||
# and do not forget to set the rhsm into the container mode again
|
||||
with mounting.NspawnActions(_get_target_userspace()) as target_context:
|
||||
rhsm.set_container_mode(target_context)
|
||||
|
||||
|
||||
-def install_target_rhui_client_if_needed(context, indata):
|
||||
+def _apply_rhui_access_preinstall_tasks(context, rhui_setup_info):
|
||||
+ if rhui_setup_info.preinstall_tasks:
|
||||
+ api.current_logger().debug('Applying RHUI preinstall tasks.')
|
||||
+ preinstall_tasks = rhui_setup_info.preinstall_tasks
|
||||
+
|
||||
+ for file_to_remove in preinstall_tasks.files_to_remove:
|
||||
+ api.current_logger().debug('Removing {0} from the scratch container.'.format(file_to_remove))
|
||||
+ context.remove(file_to_remove)
|
||||
+
|
||||
+ for copy_info in preinstall_tasks.files_to_copy_into_overlay:
|
||||
+ api.current_logger().debug(
|
||||
+ 'Copying {0} in {1} into the scratch container.'.format(copy_info.src, copy_info.dst)
|
||||
+ )
|
||||
+ context.makedirs(os.path.dirname(copy_info.dst), exists_ok=True)
|
||||
+ context.copy_to(copy_info.src, copy_info.dst)
|
||||
+
|
||||
+
|
||||
+def _apply_rhui_access_postinstall_tasks(context, rhui_setup_info):
|
||||
+ if rhui_setup_info.postinstall_tasks:
|
||||
+ api.current_logger().debug('Applying RHUI postinstall tasks.')
|
||||
+ for copy_info in rhui_setup_info.postinstall_tasks.files_to_copy:
|
||||
+ context.makedirs(os.path.dirname(copy_info.dst), exists_ok=True)
|
||||
+ debug_msg = 'Copying {0} to {1} (inside the scratch container).'
|
||||
+ api.current_logger().debug(debug_msg.format(copy_info.src, copy_info.dst))
|
||||
+ context.call(['cp', copy_info.src, copy_info.dst])
|
||||
+
|
||||
+
|
||||
+def setup_target_rhui_access_if_needed(context, indata):
|
||||
if not indata.rhui_info:
|
||||
return
|
||||
|
||||
@@ -1110,15 +1170,14 @@ def install_target_rhui_client_if_needed(context, indata):
|
||||
_create_target_userspace_directories(userspace_dir)
|
||||
|
||||
setup_info = indata.rhui_info.target_client_setup_info
|
||||
- if setup_info.preinstall_tasks:
|
||||
- preinstall_tasks = setup_info.preinstall_tasks
|
||||
+ _apply_rhui_access_preinstall_tasks(context, setup_info)
|
||||
|
||||
- for file_to_remove in preinstall_tasks.files_to_remove:
|
||||
- context.remove(file_to_remove)
|
||||
-
|
||||
- for copy_info in preinstall_tasks.files_to_copy_into_overlay:
|
||||
- context.makedirs(os.path.dirname(copy_info.dst), exists_ok=True)
|
||||
- context.copy_to(copy_info.src, copy_info.dst)
|
||||
+ if not setup_info.bootstrap_target_client:
|
||||
+ # Installation of the target RHUI client is not possible and we bundle all necessary
|
||||
+ # files into the leapp-rhui-<provider> packages.
|
||||
+ api.current_logger().debug('Bootstrapping target RHUI client is disabled, leapp will rely '
|
||||
+ 'only on files budled in leapp-rhui-<provider> package.')
|
||||
+ return
|
||||
|
||||
cmd = ['dnf', '-y']
|
||||
|
||||
@@ -1149,16 +1208,13 @@ def install_target_rhui_client_if_needed(context, indata):
|
||||
|
||||
context.call(cmd, callback_raw=utils.logging_handler, stdin='\n'.join(dnf_transaction_steps))
|
||||
|
||||
- if setup_info.postinstall_tasks:
|
||||
- for copy_info in setup_info.postinstall_tasks.files_to_copy:
|
||||
- context.makedirs(os.path.dirname(copy_info.dst), exists_ok=True)
|
||||
- context.call(['cp', copy_info.src, copy_info.dst])
|
||||
+ _apply_rhui_access_postinstall_tasks(context, setup_info)
|
||||
|
||||
# Do a cleanup so there are not duplicit repoids
|
||||
files_owned_by_clients = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
|
||||
for copy_task in setup_info.preinstall_tasks.files_to_copy_into_overlay:
|
||||
- dest = get_copy_location_from_copy_in_task(context, copy_task)
|
||||
+ dest = get_copy_location_from_copy_in_task(context.base_dir, copy_task)
|
||||
can_be_cleaned_up = copy_task.src not in setup_info.files_supporting_client_operation
|
||||
if dest not in files_owned_by_clients and can_be_cleaned_up:
|
||||
context.remove(dest)
|
||||
@@ -1184,10 +1240,10 @@ def perform():
|
||||
target_iso = next(api.consume(TargetOSInstallationImage), None)
|
||||
with mounting.mount_upgrade_iso_to_root_dir(overlay.target, target_iso):
|
||||
|
||||
- install_target_rhui_client_if_needed(context, indata)
|
||||
+ setup_target_rhui_access_if_needed(context, indata)
|
||||
|
||||
target_repoids = _gather_target_repositories(context, indata, prod_cert_path)
|
||||
- _create_target_userspace(context, indata.packages, indata.files, target_repoids)
|
||||
+ _create_target_userspace(context, indata, indata.packages, indata.files, target_repoids)
|
||||
# TODO: this is tmp solution as proper one needs significant refactoring
|
||||
target_repo_facts = repofileutils.get_parsed_repofiles(context)
|
||||
api.produce(TMPTargetRepositoriesFacts(repositories=target_repo_facts))
|
||||
diff --git a/repos/system_upgrade/common/models/rhuiinfo.py b/repos/system_upgrade/common/models/rhuiinfo.py
|
||||
index 3eaa4826..0a2e45af 100644
|
||||
--- a/repos/system_upgrade/common/models/rhuiinfo.py
|
||||
+++ b/repos/system_upgrade/common/models/rhuiinfo.py
|
||||
@@ -36,6 +36,13 @@ class TargetRHUISetupInfo(Model):
|
||||
files_supporting_client_operation = fields.List(fields.String(), default=[])
|
||||
"""A subset of files copied in preinstall tasks that should not be cleaned up."""
|
||||
|
||||
+ bootstrap_target_client = fields.Boolean(default=True)
|
||||
+ """
|
||||
+ Swap the current RHUI client for the target one to facilitate access to the target content.
|
||||
+
|
||||
+ When False, only files from the leapp-rhui-<provider> will be used to access target content.
|
||||
+ """
|
||||
+
|
||||
|
||||
class RHUIInfo(Model):
|
||||
"""
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@ -1,245 +0,0 @@
|
||||
From 004cec5bd33025412df84f07590b6c5452d70ab6 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Wed, 17 Apr 2024 09:58:00 +0200
|
||||
Subject: [PATCH 02/55] Upgrade dracut module: Update /usr mounting solution
|
||||
|
||||
Originally we had implemented our own mount_usr.sh script, which
|
||||
took care about mounting the /usr when it is present on separate
|
||||
partition / mountpoint. It took care also about LVM activation.
|
||||
|
||||
However, it has been problematic in various cases (e.g. when device
|
||||
needed more time for initialisation - e.g. when connected using FC).
|
||||
Let's use instead existing system solutions, starting
|
||||
the upgrade.target after initrd-fs.target (instead of just
|
||||
basic.target). IOW, let's get as close to the standard booting
|
||||
procedure when speaking about the storage, as possible.
|
||||
|
||||
Note that the booting is still broken in this commit and needs
|
||||
additional changes made in followup commits. But due to complexity
|
||||
of the solution, keeping this separated.
|
||||
|
||||
jira: RHEL-3344, RHEL-35446
|
||||
---
|
||||
.../85sys-upgrade-redhat/module-setup.sh | 1 -
|
||||
.../dracut/85sys-upgrade-redhat/mount_usr.sh | 148 ------------------
|
||||
.../initrd-cleanup-override.conf | 3 +
|
||||
.../dracut/90sys-upgrade/module-setup.sh | 11 ++
|
||||
.../files/dracut/90sys-upgrade/upgrade.target | 4 +-
|
||||
5 files changed, 16 insertions(+), 151 deletions(-)
|
||||
delete mode 100755 repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
create mode 100644 repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
index d73060cb..45f98148 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
@@ -102,7 +102,6 @@ install() {
|
||||
inst_binary grep
|
||||
|
||||
# script to actually run the upgrader binary
|
||||
- inst_hook upgrade 49 "$_moddir/mount_usr.sh"
|
||||
inst_hook upgrade 50 "$_moddir/do-upgrade.sh"
|
||||
|
||||
#NOTE: some clean up?.. ideally, everything should be inside the leapp*
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
deleted file mode 100755
|
||||
index 9366ac13..00000000
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
+++ /dev/null
|
||||
@@ -1,148 +0,0 @@
|
||||
-#!/bin/sh
|
||||
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
-# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
-
|
||||
-type info >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
-
|
||||
-export NEWROOT=${NEWROOT:-"/sysroot"}
|
||||
-
|
||||
-filtersubvol() {
|
||||
- _oldifs="$IFS"
|
||||
- IFS=","
|
||||
- set "$@"
|
||||
- IFS="$_oldifs"
|
||||
- while [ $# -gt 0 ]; do
|
||||
- case $1 in
|
||||
- subvol=*) :;;
|
||||
- *) printf '%s' "${1}," ;;
|
||||
- esac
|
||||
- shift
|
||||
- done
|
||||
-}
|
||||
-
|
||||
-mount_usr()
|
||||
-{
|
||||
- #
|
||||
- # mount_usr [true | false]
|
||||
- # Expected a "true" value for the last attempt to mount /usr. On the last
|
||||
- # attempt, in case of failure drop to shell.
|
||||
- #
|
||||
- # Return 0 when everything is all right
|
||||
- # In case of failure and /usr has been detected:
|
||||
- # return 2 when $1 is "true" (drop to shell invoked)
|
||||
- # (note: possibly it's nonsense, but to be sure..)
|
||||
- # return 1 otherwise
|
||||
- #
|
||||
- _last_attempt="$1"
|
||||
- # check, if we have to mount the /usr filesystem
|
||||
- while read -r _dev _mp _fs _opts _freq _passno; do
|
||||
- [ "${_dev%%#*}" != "$_dev" ] && continue
|
||||
- if [ "$_mp" = "/usr" ]; then
|
||||
- case "$_dev" in
|
||||
- LABEL=*)
|
||||
- _dev="$(echo "$_dev" | sed 's,/,\\x2f,g')"
|
||||
- _dev="/dev/disk/by-label/${_dev#LABEL=}"
|
||||
- ;;
|
||||
- UUID=*)
|
||||
- _dev="${_dev#block:}"
|
||||
- _dev="/dev/disk/by-uuid/${_dev#UUID=}"
|
||||
- ;;
|
||||
- esac
|
||||
-
|
||||
- # shellcheck disable=SC2154 # Variable root is assigned by dracut
|
||||
- _root_dev=${root#block:}
|
||||
-
|
||||
- if strstr "$_opts" "subvol=" && \
|
||||
- [ "$(stat -c '%D:%i' "$_root_dev")" = "$(stat -c '%D:%i' "$_dev")" ] && \
|
||||
- [ -n "$rflags" ]; then
|
||||
- # for btrfs subvolumes we have to mount /usr with the same rflags
|
||||
- rflags=$(filtersubvol "$rflags")
|
||||
- rflags=${rflags%%,}
|
||||
- _opts="${_opts:+${_opts},}${rflags}"
|
||||
- elif getargbool 0 ro; then
|
||||
- # if "ro" is specified, we want /usr to be mounted read-only
|
||||
- _opts="${_opts:+${_opts},}ro"
|
||||
- elif getargbool 0 rw; then
|
||||
- # if "rw" is specified, we want /usr to be mounted read-write
|
||||
- _opts="${_opts:+${_opts},}rw"
|
||||
- fi
|
||||
- echo "$_dev ${NEWROOT}${_mp} $_fs ${_opts} $_freq $_passno"
|
||||
- _usr_found="1"
|
||||
- break
|
||||
- fi
|
||||
- done < "${NEWROOT}/etc/fstab" >> /etc/fstab
|
||||
-
|
||||
- if [ "$_usr_found" = "" ]; then
|
||||
- # nothing to do
|
||||
- return 0
|
||||
- fi
|
||||
-
|
||||
- info "Mounting /usr with -o $_opts"
|
||||
- mount "${NEWROOT}/usr" 2>&1 | vinfo
|
||||
- mount -o remount,rw "${NEWROOT}/usr"
|
||||
-
|
||||
- if ismounted "${NEWROOT}/usr"; then
|
||||
- # success!!
|
||||
- return 0
|
||||
- fi
|
||||
-
|
||||
- if [ "$_last_attempt" = "true" ]; then
|
||||
- warn "Mounting /usr to ${NEWROOT}/usr failed"
|
||||
- warn "*** Dropping you to a shell; the system will continue"
|
||||
- warn "*** when you leave the shell."
|
||||
- action_on_fail
|
||||
- return 2
|
||||
- fi
|
||||
-
|
||||
- return 1
|
||||
-}
|
||||
-
|
||||
-
|
||||
-try_to_mount_usr() {
|
||||
- _last_attempt="$1"
|
||||
- if [ ! -f "${NEWROOT}/etc/fstab" ]; then
|
||||
- warn "File ${NEWROOT}/etc/fstab doesn't exist."
|
||||
- return 1
|
||||
- fi
|
||||
-
|
||||
- # In case we have the LVM command available try make it activate all partitions
|
||||
- if command -v lvm 2>/dev/null 1>/dev/null; then
|
||||
- lvm vgchange --sysinit -a y || {
|
||||
- warn "Detected problem when tried to activate LVM VG."
|
||||
- if [ "$_last_attempt" != "true" ]; then
|
||||
- # this is not last execution, retry
|
||||
- return 1
|
||||
- fi
|
||||
- # NOTE(pstodulk):
|
||||
- # last execution, so call mount_usr anyway
|
||||
- # I am not 100% about lvm vgchange exit codes and I am aware of
|
||||
- # possible warnings, in this last run, let's keep it on mount_usr
|
||||
- # anyway..
|
||||
- }
|
||||
- fi
|
||||
-
|
||||
- mount_usr "$1"
|
||||
-}
|
||||
-
|
||||
-_sleep_timeout=15
|
||||
-_last_attempt="false"
|
||||
-for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
|
||||
- info "Storage initialisation: Attempt $i of 11. Wait $_sleep_timeout seconds."
|
||||
- sleep $_sleep_timeout
|
||||
- if [ $i -eq 11 ]; then
|
||||
- _last_attempt="true"
|
||||
- fi
|
||||
- try_to_mount_usr "$_last_attempt" && break
|
||||
-
|
||||
- # something is wrong. In some cases, storage needs more time for the
|
||||
- # initialisation - especially in case of SAN.
|
||||
-
|
||||
- if [ "$_last_attempt" = "true" ]; then
|
||||
- warn "The last attempt to initialize storage has not been successful."
|
||||
- warn "Unknown state of the storage. It is possible that upgrade will be stopped."
|
||||
- break
|
||||
- fi
|
||||
-
|
||||
- warn "Failed attempt to initialize the storage. Retry..."
|
||||
-done
|
||||
-
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
new file mode 100644
|
||||
index 00000000..d24e0ef0
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
@@ -0,0 +1,3 @@
|
||||
+[Service]
|
||||
+ExecStart=
|
||||
+ExecStart=-/usr/bin/true
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
index 06479fb5..30ae57b3 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
@@ -54,6 +54,17 @@ install() {
|
||||
ln -sf "../${s}.service" "$upgrade_wantsdir"
|
||||
done
|
||||
|
||||
+ # Setup modified initrd-cleanup.service in the upgrade initramfs to enable
|
||||
+ # storage initialisation using systemd-fstab-generator. We want to run the
|
||||
+ # initrd-parse-etc.service but this one triggers also the initrd-cleanup.service
|
||||
+ # which triggers the switch-root and isolated actions that basically kills
|
||||
+ # the original upgrade service when used.
|
||||
+ # The initrd-parse-etc.service has different content across RHEL systems,
|
||||
+ # so we override rather initrd-cleanup.service instead as we do not need
|
||||
+ # that one for the upgrade process.
|
||||
+ mkdir -p "${unitdir}/initrd-cleanup.service.d"
|
||||
+ inst_simple "${_moddir}/initrd-cleanup-override.conf" "${unitdir}/initrd-cleanup.service.d/initrd-cleanup-override.conf"
|
||||
+
|
||||
# just try : set another services into the wantsdir
|
||||
# sysroot.mount \
|
||||
# dracut-mount \
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
index 366b5cab..d2bf7313 100644
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
@@ -2,7 +2,7 @@
|
||||
Description=System Upgrade
|
||||
Documentation=man:upgrade.target(7)
|
||||
# ##sysinit.target sockets.target initrd-root-fs.target initrd-root-device.target initrd-fs.target
|
||||
-Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target
|
||||
+Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target initrd-parse-etc.service
|
||||
Requires=basic.target sysroot.mount
|
||||
-After=basic.target sysroot.mount
|
||||
+After=basic.target sysroot.mount initrd-fs.target
|
||||
AllowIsolate=yes
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,132 +0,0 @@
|
||||
From 04a2ec2574da233a41d32f70eab780b6c305ff31 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Thu, 19 Dec 2024 10:33:24 +0100
|
||||
Subject: [PATCH 03/55] feat(lvm_autoactivation): add lvm autoactivation
|
||||
|
||||
Add LVM autoactivation mechanism to the upgrade initramfs. The core
|
||||
of the mechanism is based on a special udev rule that is triggered
|
||||
when a new device is detected. The rule then calls two lvm binaries
|
||||
(which are also included into the upgrade initrams) to activate
|
||||
the volume groups and logical volumes.
|
||||
---
|
||||
.../enable_lvm_autoactivation/actor.py | 21 ++++++++
|
||||
.../libraries/enable_lvm_autoactivation.py | 21 ++++++++
|
||||
.../test_lvm_autoactivation_enablement.py | 50 +++++++++++++++++++
|
||||
3 files changed, 92 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..aba60645
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import enable_lvm_autoactivation as enable_lvm_autoactivation_lib
|
||||
+from leapp.models import DistributionSignedRPM, UpgradeInitramfsTasks
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class EnableLVMAutoactivation(Actor):
|
||||
+ """
|
||||
+ Enable LVM autoactivation in upgrade initramfs.
|
||||
+
|
||||
+ Produce instructions for upgrade initramfs generation that will result in LVM
|
||||
+ autoactivation in the initramfs.
|
||||
+ """
|
||||
+
|
||||
+ name = 'enable_lvm_autoactivation'
|
||||
+ consumes = (DistributionSignedRPM,)
|
||||
+ produces = (UpgradeInitramfsTasks, )
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ enable_lvm_autoactivation_lib.emit_lvm_autoactivation_instructions()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
new file mode 100644
|
||||
index 00000000..e312277b
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def emit_lvm_autoactivation_instructions():
|
||||
+ if not has_package(DistributionSignedRPM, 'lvm2'):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Upgrade initramfs will not autoenable LVM devices - `lvm2` RPM is not installed.'
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ # the 69-dm-lvm.rules trigger pvscan and vgchange when LVM device is detected
|
||||
+ files_to_include = [
|
||||
+ '/usr/sbin/pvscan',
|
||||
+ '/usr/sbin/vgchange',
|
||||
+ '/usr/lib/udev/rules.d/69-dm-lvm.rules'
|
||||
+ ]
|
||||
+ lvm_autoactivation_instructions = UpgradeInitramfsTasks(include_files=files_to_include)
|
||||
+
|
||||
+ api.produce(lvm_autoactivation_instructions)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
new file mode 100644
|
||||
index 00000000..c5150aea
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
@@ -0,0 +1,50 @@
|
||||
+from leapp.libraries.actor import enable_lvm_autoactivation
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, produce_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM, RPM, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def test_emit_lvm_autoactivation_instructions_produces_correct_message(monkeypatch):
|
||||
+ """Test that emit_lvm_autoactivation_instructions produces UpgradeInitramfsTasks with correct files."""
|
||||
+ lvm_package = RPM(
|
||||
+ name='lvm2',
|
||||
+ version='2',
|
||||
+ release='1',
|
||||
+ epoch='1',
|
||||
+ packager='',
|
||||
+ arch='x86_64',
|
||||
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51'
|
||||
+ )
|
||||
+
|
||||
+ msgs = [
|
||||
+ DistributionSignedRPM(items=[lvm_package])
|
||||
+ ]
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ enable_lvm_autoactivation.emit_lvm_autoactivation_instructions()
|
||||
+
|
||||
+ assert api.produce.called == 1
|
||||
+
|
||||
+ produced_msg = api.produce.model_instances[0]
|
||||
+
|
||||
+ assert isinstance(produced_msg, UpgradeInitramfsTasks)
|
||||
+
|
||||
+ expected_files = [
|
||||
+ '/usr/sbin/pvscan',
|
||||
+ '/usr/sbin/vgchange',
|
||||
+ '/usr/lib/udev/rules.d/69-dm-lvm.rules'
|
||||
+ ]
|
||||
+ assert produced_msg.include_files == expected_files
|
||||
+
|
||||
+
|
||||
+def test_no_action_if_lvm_rpm_missing(monkeypatch):
|
||||
+ msgs = [
|
||||
+ DistributionSignedRPM(items=[])
|
||||
+ ]
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ enable_lvm_autoactivation.emit_lvm_autoactivation_instructions()
|
||||
+
|
||||
+ assert api.produce.called == 0
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,658 +0,0 @@
|
||||
From 47fce173e75408d9a7a26225d389161caf72e244 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Sun, 31 Aug 2025 23:49:57 +0200
|
||||
Subject: [PATCH 04/55] feat(mount_unit_gen): generate mount units for the
|
||||
upgrade initramfs
|
||||
|
||||
Run systemd-fstab-generator to produce mount units that correspond to
|
||||
the content of source system's fstab. The generated mount units are then
|
||||
modified to mount /target into /sysroot/target, to reflect that the root
|
||||
of the source system is mounted as /sysroot. These mount units are made
|
||||
dependencies of local-fs.target, and, therefore, will be triggered by
|
||||
systemd before the upgrade.
|
||||
|
||||
Assisted-by: Cursor (Claude Sonnet 4)
|
||||
Jira-ref: RHEL-35446
|
||||
|
||||
@pstodulk:
|
||||
Updated the code to cover also other systemd targets that can be
|
||||
covered by systemd-fstab-generator. Also cover the situation when
|
||||
a directory with systemd target (requires, wants) already exists.
|
||||
Tests have been updated.
|
||||
|
||||
Note that there are still possible issues hidden in the generate
|
||||
mount unit files as we update at this moment just the `Where` clause
|
||||
however we are not touching anything else. (Before, After,
|
||||
RequiresMountsFor, ...). But keeping that for future development and
|
||||
testing. The call for `mount -a` is still present, we expect followup
|
||||
PRs at this point.
|
||||
|
||||
Co-authored-by: Petr Stodulka <pstodulk@redhat.com>
|
||||
---
|
||||
.../initramfs/mount_units_generator/actor.py | 22 ++
|
||||
.../libraries/mount_unit_generator.py | 307 ++++++++++++++++++
|
||||
.../tests/test_mount_unit_generation.py | 269 +++++++++++++++
|
||||
3 files changed, 598 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..5fe25515
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -0,0 +1,22 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class MountUnitGenerator(Actor):
|
||||
+ """
|
||||
+ Sets up storage initialization using systemd's mount units in the upgrade container.
|
||||
+ """
|
||||
+
|
||||
+ name = 'mount_unit_generator'
|
||||
+ consumes = (
|
||||
+ TargetUserSpaceInfo,
|
||||
+ )
|
||||
+ produces = (
|
||||
+ UpgradeInitramfsTasks,
|
||||
+ )
|
||||
+ tags = (IPUWorkflowTag, InterimPreparationPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ mount_unit_generator_lib.setup_storage_initialization()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
new file mode 100644
|
||||
index 00000000..e1060559
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -0,0 +1,307 @@
|
||||
+import os
|
||||
+import shutil
|
||||
+import tempfile
|
||||
+
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.common import mounting
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def run_systemd_fstab_generator(output_directory):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Generating mount units for the source system into {}'.format(output_directory)
|
||||
+ )
|
||||
+
|
||||
+ try:
|
||||
+ generator_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_directory,
|
||||
+ output_directory,
|
||||
+ output_directory
|
||||
+ ]
|
||||
+ run(generator_cmd)
|
||||
+ except CalledProcessError as error:
|
||||
+ api.current_logger().error(
|
||||
+ 'Failed to generate mount units using systemd-fstab-generator. Error: {}'.format(error)
|
||||
+ )
|
||||
+ details = {'details': str(error)}
|
||||
+ raise StopActorExecutionError(
|
||||
+ 'Failed to generate mount units using systemd-fstab-generator',
|
||||
+ details
|
||||
+ )
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Mount units successfully generated into {}'.format(output_directory)
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def _read_unit_file_lines(unit_file_path): # Encapsulate IO for tests
|
||||
+ with open(unit_file_path) as unit_file:
|
||||
+ return unit_file.readlines()
|
||||
+
|
||||
+
|
||||
+def _write_unit_file_lines(unit_file_path, lines): # Encapsulate IO for tests
|
||||
+ with open(unit_file_path, 'w') as unit_file:
|
||||
+ unit_file.write('\n'.join(lines) + '\n')
|
||||
+
|
||||
+
|
||||
+def _delete_file(file_path):
|
||||
+ os.unlink(file_path)
|
||||
+
|
||||
+
|
||||
+def _prefix_mount_unit_with_sysroot(mount_unit_path, new_unit_destination):
|
||||
+ """
|
||||
+ Prefix the mount target with /sysroot as expected in the upgrade initramfs.
|
||||
+
|
||||
+ A new mount unit file is written to new_unit_destination.
|
||||
+ """
|
||||
+ # NOTE(pstodulk): Note that right now we update just the 'Where' key, however
|
||||
+ # what about RequiresMountsFor, .. there could be some hidden dragons.
|
||||
+ # In case of issues, investigate these values in generated unit files.
|
||||
+ api.current_logger().debug(
|
||||
+ 'Prefixing {}\'s mount target with /sysroot. Output will be written to {}'.format(
|
||||
+ mount_unit_path,
|
||||
+ new_unit_destination
|
||||
+ )
|
||||
+ )
|
||||
+ unit_lines = _read_unit_file_lines(mount_unit_path)
|
||||
+
|
||||
+ output_lines = []
|
||||
+ for line in unit_lines:
|
||||
+ line = line.strip()
|
||||
+ if not line.startswith('Where='):
|
||||
+ output_lines.append(line)
|
||||
+ continue
|
||||
+
|
||||
+ _, destination = line.split('=', 1)
|
||||
+ new_destination = os.path.join('/sysroot', destination.lstrip('/'))
|
||||
+
|
||||
+ output_lines.append('Where={}'.format(new_destination))
|
||||
+
|
||||
+ _write_unit_file_lines(new_unit_destination, output_lines)
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Done. Modified mount unit successfully written to {}'.format(new_unit_destination)
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def prefix_all_mount_units_with_sysroot(dir_containing_units):
|
||||
+ for unit_file_path in os.listdir(dir_containing_units):
|
||||
+ # systemd requires mount path to be in the unit name
|
||||
+ modified_unit_destination = 'sysroot-{}'.format(unit_file_path)
|
||||
+ modified_unit_destination = os.path.join(dir_containing_units, modified_unit_destination)
|
||||
+
|
||||
+ unit_file_path = os.path.join(dir_containing_units, unit_file_path)
|
||||
+
|
||||
+ if not unit_file_path.endswith('.mount'):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Skipping {} when prefixing mount units with /sysroot - not a mount unit.'.format(
|
||||
+ unit_file_path
|
||||
+ )
|
||||
+ )
|
||||
+ continue
|
||||
+
|
||||
+ _prefix_mount_unit_with_sysroot(unit_file_path, modified_unit_destination)
|
||||
+
|
||||
+ _delete_file(unit_file_path)
|
||||
+ api.current_logger().debug('Original mount unit {} removed.'.format(unit_file_path))
|
||||
+
|
||||
+
|
||||
+def _fix_symlinks_in_dir(dir_containing_mount_units, target_dir):
|
||||
+ """
|
||||
+ Fix broken symlinks in given target_dir due to us modifying (renaming) the mount units.
|
||||
+
|
||||
+ The target_dir contains symlinks to the (mount) units that are required
|
||||
+ in order for the local-fs.target to be reached. However, we renamed these units to reflect
|
||||
+ that we have changed their mount destinations by prefixing the mount destination with /sysroot.
|
||||
+ Hence, we regenerate the symlinks.
|
||||
+ """
|
||||
+
|
||||
+ target_dir_path = os.path.join(dir_containing_mount_units, target_dir)
|
||||
+ if not os.path.exists(target_dir_path):
|
||||
+ api.current_logger().debug(
|
||||
+ 'The {} directory does not exist. Skipping'
|
||||
+ .format(target_dir)
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Removing the old {} directory from {}.'
|
||||
+ .format(target_dir, dir_containing_mount_units)
|
||||
+ )
|
||||
+
|
||||
+ shutil.rmtree(target_dir_path)
|
||||
+ os.mkdir(target_dir_path)
|
||||
+
|
||||
+ api.current_logger().debug('Populating {} with new symlinks.'.format(target_dir))
|
||||
+
|
||||
+ for unit_file in os.listdir(dir_containing_mount_units):
|
||||
+ if not unit_file.endswith('.mount'):
|
||||
+ continue
|
||||
+
|
||||
+ place_fastlink_at = os.path.join(target_dir_path, unit_file)
|
||||
+ fastlink_points_to = os.path.join('../', unit_file)
|
||||
+ try:
|
||||
+ run(['ln', '-s', fastlink_points_to, place_fastlink_at])
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Dependency on {} created.'.format(unit_file)
|
||||
+ )
|
||||
+ except CalledProcessError as err:
|
||||
+ err_descr = (
|
||||
+ 'Failed to create required unit dependencies under {} for the upgrade initramfs.'
|
||||
+ .format(target_dir)
|
||||
+ )
|
||||
+ details = {'details': str(err)}
|
||||
+ raise StopActorExecutionError(err_descr, details=details)
|
||||
+
|
||||
+
|
||||
+def fix_symlinks_in_targets(dir_containing_mount_units):
|
||||
+ """
|
||||
+ Fix broken symlinks in *.target.* directories caused by earlier modified mount units.
|
||||
+
|
||||
+ Generated mount unit files are part of one of systemd targets (list below),
|
||||
+ which means that a symlink from a systemd target to exists for each of
|
||||
+ them. Based on this, systemd knows when (local or remote file systems?)
|
||||
+ they must (".requires" suffix") or could (".wants" suffix) be mounted.
|
||||
+ See the man 5 systemd.mount for more details how mount units are split into
|
||||
+ these targets.
|
||||
+
|
||||
+ The list of possible target directories where these mount units could end:
|
||||
+ * local-fs.target.requires
|
||||
+ * local-fs.target.wants
|
||||
+ * local-fs-pre.target.requires
|
||||
+ * local-fs-pre.target.wants
|
||||
+ * remote-fs.target.requires
|
||||
+ * remote-fs.target.wants
|
||||
+ * remote-fs-pre.target.requires
|
||||
+ * remote-fs-pre.target.wants
|
||||
+ Most likely, unit files are not generated for "*pre*" targets, but to be
|
||||
+ sure really. Longer list does not cause any issues in this code.
|
||||
+
|
||||
+ In most cases, "local-fs.target.requires" is the only important directory
|
||||
+ for us during the upgrade. But in some (sometimes common) cases we will
|
||||
+ need some of the others as well.
|
||||
+
|
||||
+ These directories do not have to necessarily exists if there are no mount
|
||||
+ unit files that could be put there. But most likely "local-fs.target.requires"
|
||||
+ will always exists.
|
||||
+ """
|
||||
+ dir_list = [
|
||||
+ 'local-fs.target.requires',
|
||||
+ 'local-fs.target.wants',
|
||||
+ 'local-fs-pre.target.requires',
|
||||
+ 'local-fs-pre.target.wants',
|
||||
+ 'remote-fs.target.requires',
|
||||
+ 'remote-fs.target.wants',
|
||||
+ 'remote-fs-pre.target.requires',
|
||||
+ 'remote-fs-pre.target.wants',
|
||||
+ ]
|
||||
+ for tdir in dir_list:
|
||||
+ _fix_symlinks_in_dir(dir_containing_mount_units, tdir)
|
||||
+
|
||||
+
|
||||
+def copy_units_into_system_location(upgrade_container_ctx, dir_with_our_mount_units):
|
||||
+ """
|
||||
+ Copy units and their .wants/.requires directories into the target userspace container.
|
||||
+
|
||||
+ :return: A list of files in the target userspace that were created by copying.
|
||||
+ :rtype: list[str]
|
||||
+ """
|
||||
+ dest_inside_container = '/usr/lib/systemd/system'
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Copying generated mount units for upgrade from {} to {}'.format(
|
||||
+ dir_with_our_mount_units,
|
||||
+ upgrade_container_ctx.full_path(dest_inside_container)
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ copied_files = []
|
||||
+ prefix_len_to_drop = len(upgrade_container_ctx.base_dir)
|
||||
+
|
||||
+ # We cannot rely on mounting library when copying into container
|
||||
+ # as we want to control what happens to symlinks and
|
||||
+ # shutil.copytree in Python3.6 fails if dst directory exists already
|
||||
+ # - which happens in some cases when copying these files.
|
||||
+ for root, dummy_dirs, files in os.walk(dir_with_our_mount_units):
|
||||
+ rel_path = os.path.relpath(root, dir_with_our_mount_units)
|
||||
+ if rel_path == '.':
|
||||
+ rel_path = ''
|
||||
+ dst_dir = os.path.join(upgrade_container_ctx.full_path(dest_inside_container), rel_path)
|
||||
+ os.makedirs(dst_dir, mode=0o755, exist_ok=True)
|
||||
+
|
||||
+ for file in files:
|
||||
+ src_file = os.path.join(root, file)
|
||||
+ dst_file = os.path.join(dst_dir, file)
|
||||
+ api.current_logger().debug(
|
||||
+ 'Copying mount unit file {} to {}'.format(src_file, dst_file)
|
||||
+ )
|
||||
+ if os.path.islink(dst_file):
|
||||
+ # If the target file already exists and it is a symlink, it will
|
||||
+ # fail and we want to overwrite this.
|
||||
+ # NOTE(pstodulk): You could think that it cannot happen, but
|
||||
+ # in future possibly it could happen, so let's rather be careful
|
||||
+ # and handle it. If the dst file exists, we want to overwrite it
|
||||
+ # for sure
|
||||
+ _delete_file(dst_file)
|
||||
+ shutil.copy2(src_file, dst_file, follow_symlinks=False)
|
||||
+ copied_files.append(dst_file[prefix_len_to_drop:])
|
||||
+
|
||||
+ return copied_files
|
||||
+
|
||||
+
|
||||
+def remove_units_for_targets_that_are_already_mounted_by_dracut(dir_with_our_mount_units):
|
||||
+ """
|
||||
+ Remove mount units for mount targets that are already mounted by dracut.
|
||||
+
|
||||
+ Namely, remove mount units:
|
||||
+ '-.mount' (mounts /)
|
||||
+ 'usr.mount' (mounts /usr)
|
||||
+ """
|
||||
+
|
||||
+ # NOTE: remount-fs.service creates dependency cycles that are nondeterministically broken
|
||||
+ # by systemd, causing unpredictable failures. The service is supposed to remount root
|
||||
+ # and /usr, reapplying mount options from /etc/fstab. However, the fstab file present in
|
||||
+ # the initramfs is not the fstab from the source system, and, therefore, it is pointless
|
||||
+ # to require the service. It would make sense after we switched root during normal boot
|
||||
+ # process.
|
||||
+ already_mounted_units = [
|
||||
+ '-.mount',
|
||||
+ 'usr.mount',
|
||||
+ 'local-fs.target.wants/systemd-remount-fs.service'
|
||||
+ ]
|
||||
+
|
||||
+ for unit in already_mounted_units:
|
||||
+ unit_location = os.path.join(dir_with_our_mount_units, unit)
|
||||
+
|
||||
+ if not os.path.exists(unit_location):
|
||||
+ api.current_logger().debug('The {} unit does not exists, no need to remove it.'.format(unit))
|
||||
+ continue
|
||||
+
|
||||
+ _delete_file(unit_location)
|
||||
+
|
||||
+
|
||||
+def request_units_inclusion_in_initramfs(files_to_include):
|
||||
+ api.current_logger().debug('Including the following files into initramfs: {}'.format(files_to_include))
|
||||
+
|
||||
+ additional_files = [
|
||||
+ '/usr/sbin/swapon' # If the system has swap, we have also generated a swap unit to activate it
|
||||
+ ]
|
||||
+
|
||||
+ tasks = UpgradeInitramfsTasks(include_files=files_to_include + additional_files)
|
||||
+ api.produce(tasks)
|
||||
+
|
||||
+
|
||||
+def setup_storage_initialization():
|
||||
+ userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
+
|
||||
+ with mounting.NspawnActions(base_dir=userspace_info.path) as upgrade_container_ctx:
|
||||
+ with tempfile.TemporaryDirectory(dir='/var/lib/leapp/', prefix='tmp_systemd_fstab_') as workspace_path:
|
||||
+ run_systemd_fstab_generator(workspace_path)
|
||||
+ remove_units_for_targets_that_are_already_mounted_by_dracut(workspace_path)
|
||||
+ prefix_all_mount_units_with_sysroot(workspace_path)
|
||||
+ fix_symlinks_in_targets(workspace_path)
|
||||
+ mount_unit_files = copy_units_into_system_location(upgrade_container_ctx, workspace_path)
|
||||
+ request_units_inclusion_in_initramfs(mount_unit_files)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
new file mode 100644
|
||||
index 00000000..b814f6ce
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -0,0 +1,269 @@
|
||||
+import os
|
||||
+import shutil
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.actor import mount_unit_generator
|
||||
+from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def test_run_systemd_fstab_generator_successful_generation(monkeypatch):
|
||||
+ """Test successful mount unit generation."""
|
||||
+
|
||||
+ output_dir = '/tmp/test_output'
|
||||
+ expected_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_dir,
|
||||
+ output_dir,
|
||||
+ output_dir
|
||||
+ ]
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ assert command == expected_cmd
|
||||
+
|
||||
+ return {
|
||||
+ "stdout": "",
|
||||
+ "stderr": "",
|
||||
+ "exit_code": 0,
|
||||
+ }
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+ mount_unit_generator.run_systemd_fstab_generator(output_dir)
|
||||
+
|
||||
+
|
||||
+def test_run_systemd_fstab_generator_failure(monkeypatch):
|
||||
+ """Test handling of systemd-fstab-generator failure."""
|
||||
+ output_dir = '/tmp/test_output'
|
||||
+ expected_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_dir,
|
||||
+ output_dir,
|
||||
+ output_dir
|
||||
+ ]
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ assert command == expected_cmd
|
||||
+ raise CalledProcessError(message='Generator failed', command=['test'], result={'exit_code': 1})
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError):
|
||||
+ mount_unit_generator.run_systemd_fstab_generator(output_dir)
|
||||
+
|
||||
+
|
||||
+def test_prefix_mount_unit_with_sysroot(monkeypatch):
|
||||
+ """Test prefixing a single mount unit with /sysroot."""
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+
|
||||
+ input_content = [
|
||||
+ "[Unit]\n",
|
||||
+ "Description=Test Mount\n",
|
||||
+ "[Mount]\n",
|
||||
+ "Where=/home\n",
|
||||
+ "What=/dev/sda1\n"
|
||||
+ ]
|
||||
+
|
||||
+ expected_output_lines = [
|
||||
+ "[Unit]",
|
||||
+ "Description=Test Mount",
|
||||
+ "[Mount]",
|
||||
+ "Where=/sysroot/home",
|
||||
+ "What=/dev/sda1"
|
||||
+ ]
|
||||
+
|
||||
+ def mock_read_unit_file_lines(unit_file_path):
|
||||
+ return input_content
|
||||
+
|
||||
+ def mock_write_unit_file_lines(unit_file_path, lines):
|
||||
+ assert unit_file_path == '/test/output.mount'
|
||||
+ assert lines == expected_output_lines
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_read_unit_file_lines', mock_read_unit_file_lines)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_write_unit_file_lines', mock_write_unit_file_lines)
|
||||
+
|
||||
+ mount_unit_generator._prefix_mount_unit_with_sysroot(
|
||||
+ '/test/input.mount',
|
||||
+ '/test/output.mount'
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def test_prefix_all_mount_units_with_sysroot(monkeypatch):
|
||||
+ """Test prefixing all mount units in a directory."""
|
||||
+
|
||||
+ expected_changes = {
|
||||
+ '/test/dir/home.mount': {
|
||||
+ 'new_unit_destination': '/test/dir/sysroot-home.mount',
|
||||
+ 'should_be_deleted': True,
|
||||
+ 'deleted': False,
|
||||
+ },
|
||||
+ '/test/dir/var.mount': {
|
||||
+ 'new_unit_destination': '/test/dir/sysroot-var.mount',
|
||||
+ 'should_be_deleted': True,
|
||||
+ 'deleted': False,
|
||||
+ },
|
||||
+ '/test/dir/not-a-mount.service': {
|
||||
+ 'new_unit_destination': None,
|
||||
+ 'should_be_deleted': False,
|
||||
+ 'deleted': False,
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ def mock_listdir(dir_path):
|
||||
+ return ['home.mount', 'var.mount', 'not-a-mount.service']
|
||||
+
|
||||
+ def mock_delete_file(file_path):
|
||||
+ assert file_path in expected_changes
|
||||
+ expected_changes[file_path]['deleted'] = True
|
||||
+
|
||||
+ def mock_prefix(unit_file_path, new_unit_destination):
|
||||
+ assert expected_changes[unit_file_path]['new_unit_destination'] == new_unit_destination
|
||||
+
|
||||
+ monkeypatch.setattr('os.listdir', mock_listdir)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_delete_file', mock_delete_file)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_prefix_mount_unit_with_sysroot', mock_prefix)
|
||||
+
|
||||
+ mount_unit_generator.prefix_all_mount_units_with_sysroot('/test/dir')
|
||||
+
|
||||
+ for original_mount_unit_location in expected_changes:
|
||||
+ should_be_deleted = expected_changes[original_mount_unit_location]['should_be_deleted']
|
||||
+ was_deleted = expected_changes[original_mount_unit_location]['deleted']
|
||||
+ assert should_be_deleted == was_deleted
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('dirname', (
|
||||
+ 'local-fs.target.requires',
|
||||
+ 'local-fs.target.wants',
|
||||
+ 'local-fs-pre.target.requires',
|
||||
+ 'local-fs-pre.target.wants',
|
||||
+ 'remote-fs.target.requires',
|
||||
+ 'remote-fs.target.wants',
|
||||
+ 'remote-fs-pre.target.requires',
|
||||
+ 'remote-fs-pre.target.wants',
|
||||
+))
|
||||
+def test_fix_symlinks_in_dir(monkeypatch, dirname):
|
||||
+ """Test fixing local-fs.target.requires symlinks."""
|
||||
+
|
||||
+ DIR_PATH = os.path.join('/test/dir/', dirname)
|
||||
+
|
||||
+ def mock_rmtree(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+
|
||||
+ def mock_mkdir(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+
|
||||
+ def mock_listdir(dir_path):
|
||||
+ return ['sysroot-home.mount', 'sysroot-var.mount', 'not-a-mount.service']
|
||||
+
|
||||
+ def mock_os_path_exist(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+ return dir_path == DIR_PATH
|
||||
+
|
||||
+ expected_calls = [
|
||||
+ ['ln', '-s', '../sysroot-home.mount', os.path.join(DIR_PATH, 'sysroot-home.mount')],
|
||||
+ ['ln', '-s', '../sysroot-var.mount', os.path.join(DIR_PATH, 'sysroot-var.mount')]
|
||||
+ ]
|
||||
+ call_count = 0
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ nonlocal call_count
|
||||
+ assert command in expected_calls
|
||||
+ call_count += 1
|
||||
+ return {
|
||||
+ "stdout": "",
|
||||
+ "stderr": "",
|
||||
+ "exit_code": 0,
|
||||
+ }
|
||||
+
|
||||
+ monkeypatch.setattr('shutil.rmtree', mock_rmtree)
|
||||
+ monkeypatch.setattr('os.mkdir', mock_mkdir)
|
||||
+ monkeypatch.setattr('os.listdir', mock_listdir)
|
||||
+ monkeypatch.setattr('os.path.exists', mock_os_path_exist)
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+
|
||||
+ mount_unit_generator._fix_symlinks_in_dir('/test/dir', dirname)
|
||||
+
|
||||
+
|
||||
+# Test the copy_units_into_system_location function
|
||||
+def test_copy_units_mixed_content(monkeypatch):
|
||||
+ """Test copying units with mixed files and directories."""
|
||||
+
|
||||
+ def mock_walk(dir_path):
|
||||
+ tuples_to_yield = [
|
||||
+ ('/source/dir', ['local-fs.target.requires'], ['unit1.mount', 'unit2.mount']),
|
||||
+ ('/source/dir/local-fs.target.requires', [], ['unit1.mount', 'unit2.mount']),
|
||||
+ ]
|
||||
+ for i in tuples_to_yield:
|
||||
+ yield i
|
||||
+
|
||||
+ def mock_isdir(path):
|
||||
+ return 'local-fs.target.requires' in path
|
||||
+
|
||||
+ def _make_couple(sub_path):
|
||||
+ return (
|
||||
+ os.path.join('/source/dir/', sub_path),
|
||||
+ os.path.join('/container/usr/lib/systemd/system/', sub_path)
|
||||
+ )
|
||||
+
|
||||
+ def mock_copy2(src, dst, follow_symlinks=True):
|
||||
+ valid_combinations = [
|
||||
+ _make_couple('unit1.mount'),
|
||||
+ _make_couple('unit2.mount'),
|
||||
+ _make_couple('local-fs.target.requires/unit1.mount'),
|
||||
+ _make_couple('local-fs.target.requires/unit2.mount'),
|
||||
+ ]
|
||||
+ assert not follow_symlinks
|
||||
+ assert (src, dst) in valid_combinations
|
||||
+
|
||||
+ def mock_islink(file_path):
|
||||
+ return file_path == '/container/usr/lib/systemd/system/local-fs.target.requires/unit2.mount'
|
||||
+
|
||||
+ class MockedDeleteFile:
|
||||
+ def __init__(self):
|
||||
+ self.removal_called = False
|
||||
+
|
||||
+ def __call__(self, file_path):
|
||||
+ assert file_path == '/container/usr/lib/systemd/system/local-fs.target.requires/unit2.mount'
|
||||
+ self.removal_called = True
|
||||
+
|
||||
+ def mock_makedirs(dst_dir, mode=0o777, exist_ok=False):
|
||||
+ assert exist_ok
|
||||
+ assert mode == 0o755
|
||||
+
|
||||
+ allowed_paths = [
|
||||
+ '/container/usr/lib/systemd/system',
|
||||
+ '/container/usr/lib/systemd/system/local-fs.target.requires'
|
||||
+ ]
|
||||
+ assert dst_dir.rstrip('/') in allowed_paths
|
||||
+
|
||||
+ monkeypatch.setattr(os, 'walk', mock_walk)
|
||||
+ monkeypatch.setattr(os, 'makedirs', mock_makedirs)
|
||||
+ monkeypatch.setattr(os.path, 'isdir', mock_isdir)
|
||||
+ monkeypatch.setattr(os.path, 'islink', mock_islink)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_delete_file', MockedDeleteFile())
|
||||
+ monkeypatch.setattr(shutil, 'copy2', mock_copy2)
|
||||
+
|
||||
+ class MockedContainerContext:
|
||||
+ def __init__(self):
|
||||
+ self.base_dir = '/container'
|
||||
+
|
||||
+ def full_path(self, path):
|
||||
+ return os.path.join('/container', path.lstrip('/'))
|
||||
+
|
||||
+ mock_container = MockedContainerContext()
|
||||
+
|
||||
+ files = mount_unit_generator.copy_units_into_system_location(
|
||||
+ mock_container, '/source/dir'
|
||||
+ )
|
||||
+
|
||||
+ expected_files = [
|
||||
+ '/usr/lib/systemd/system/unit1.mount',
|
||||
+ '/usr/lib/systemd/system/unit2.mount',
|
||||
+ '/usr/lib/systemd/system/local-fs.target.requires/unit1.mount',
|
||||
+ '/usr/lib/systemd/system/local-fs.target.requires/unit2.mount',
|
||||
+ ]
|
||||
+ assert sorted(files) == sorted(expected_files)
|
||||
+ assert mount_unit_generator._delete_file.removal_called
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,101 +0,0 @@
|
||||
From e26359877b1d90d1f95a424216a00e711c72c923 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 9 Sep 2025 13:56:37 +0200
|
||||
Subject: [PATCH 05/55] Prevent sssdupdate actor from rising errors
|
||||
|
||||
Potential error rise (StopActorExecutionError) is replaced with
|
||||
warning logs in the SSSD update file processing function. This
|
||||
prevents the upgrade from failing when accessing non-critical files.
|
||||
Also fix minor formatting nit picks.
|
||||
|
||||
Jira: RHEL-108992
|
||||
---
|
||||
.../sssd/sssdchecks/libraries/sssdchecks.py | 4 ++--
|
||||
.../sssd/sssdfacts/libraries/sssdfacts.py | 5 ++++-
|
||||
.../sssd/sssdupdate/libraries/sssdupdate.py | 18 +++++++-----------
|
||||
3 files changed, 13 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
index 0a86fa7b..cb95026c 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
@@ -15,8 +15,8 @@ def check_config(model):
|
||||
'SSSD\'s sss_ssh_knownhostsproxy tool is replaced by the more '
|
||||
'reliable sss_ssh_knownhosts tool. SSH\'s configuration will be updated '
|
||||
'to reflect this by updating every mention of sss_ssh_knownhostsproxy by '
|
||||
- 'the corresponding mention of sss_ssh_knownhosts, even those commented out.\n'
|
||||
- 'SSSD\'s ssh service will be enabled if not already done.\n'
|
||||
+ 'the corresponding mention of sss_ssh_knownhosts, even those commented out. '
|
||||
+ 'SSSD\'s ssh service will be enabled if not already done.\n\n'
|
||||
'The following files will be updated:{}{}'.format(
|
||||
FMT_LIST_SEPARATOR,
|
||||
FMT_LIST_SEPARATOR.join(model.sssd_config_files + model.ssh_config_files)
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
index 0ae9d93f..7d343229 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
@@ -19,7 +19,10 @@ def _does_file_contain_expression(file_path, expression):
|
||||
)
|
||||
return False
|
||||
except OSError as e:
|
||||
- raise StopActorExecutionError('Could not open file ' + file_path, details={'details': str(e)})
|
||||
+ raise StopActorExecutionError(
|
||||
+ 'Could not open configuration file',
|
||||
+ details={'details': 'Coudn\'t open {} file with error: {}.'.format(file_path, str(e))}
|
||||
+ )
|
||||
|
||||
|
||||
def _look_for_files(expression: str, path_list: list[str]) -> list[str]:
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
index 6d745ead..5b96bcc6 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
-from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.stdlib import api
|
||||
|
||||
|
||||
def _process_knownhosts(line: str) -> str:
|
||||
@@ -29,30 +29,26 @@ def _process_enable_svc(line: str) -> str:
|
||||
|
||||
|
||||
def _update_file(filename, process_function):
|
||||
- newname = filename + '.new'
|
||||
- oldname = filename + '.old'
|
||||
+ newname = '{}.leappnew'.format(filename)
|
||||
+ oldname = '{}.leappsave'.format(filename)
|
||||
try:
|
||||
- with open(filename, 'r') as input_file, open(newname, 'x') as output_file:
|
||||
+ with open(filename, 'r') as input_file, open(newname, 'w') as output_file:
|
||||
istat = os.fstat(input_file.fileno())
|
||||
os.fchmod(output_file.fileno(), istat.st_mode)
|
||||
for line in input_file:
|
||||
try:
|
||||
output_file.write(process_function(line))
|
||||
except OSError as e:
|
||||
- raise StopActorExecutionError('Failed to write to {}'.format(newname),
|
||||
- details={'details': str(e)})
|
||||
+ api.current_logger().warning('Failed to write to {}'.format(newname), details={'details': str(e)})
|
||||
|
||||
- except FileExistsError as e:
|
||||
- raise StopActorExecutionError('Temporary file already exists: {}'.format(newname),
|
||||
- details={'details': str(e)})
|
||||
except OSError as e:
|
||||
try:
|
||||
os.unlink(newname)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
- raise StopActorExecutionError('Failed to access the required files', details={'details': str(e)})
|
||||
+ api.current_logger().error('Failed to access the required files', details={'details': str(e)})
|
||||
|
||||
- # Let's make sure the old configuration is preserverd if something goes wrong
|
||||
+ # Let's make sure the old configuration is preserved if something goes wrong
|
||||
os.replace(filename, oldname)
|
||||
os.replace(newname, filename)
|
||||
os.unlink(oldname)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,132 +0,0 @@
|
||||
From 23d8f69509e692ceaa3dacc0de927349ec056189 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Tue, 19 Aug 2025 09:19:18 +0200
|
||||
Subject: [PATCH 06/55] Update our test container to Fedora 42
|
||||
|
||||
The distro.linux_distribution in createresumeservice test is replaced
|
||||
distro.id(). The distro.linux_distribution has been deprecated and on
|
||||
Fedora 42 containerized tests with python3.13 it doesn't work correctly
|
||||
and the createresumeservice tests don't get skipped.
|
||||
|
||||
Jira: RHELMISC-13271
|
||||
---
|
||||
Makefile | 19 +++++++++----------
|
||||
.../tests/test_createresumeservice.py | 2 +-
|
||||
.../{Containerfile.f34 => Containerfile.f42} | 4 ++--
|
||||
3 files changed, 12 insertions(+), 13 deletions(-)
|
||||
rename utils/container-tests/{Containerfile.f34 => Containerfile.f42} (84%)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 81b16376..e0fc7e00 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -165,7 +165,7 @@ help:
|
||||
@echo " MR=6 COPR_CONFIG='path/to/the/config/copr/file' make <target>"
|
||||
@echo " ACTOR=<actor> TEST_LIBS=y make test"
|
||||
@echo " BUILD_CONTAINER=rhel8 make build_container"
|
||||
- @echo " TEST_CONTAINER=f34 make test_container"
|
||||
+ @echo " TEST_CONTAINER=f42 make test_container"
|
||||
@echo " CONTAINER_TOOL=docker TEST_CONTAINER=rhel8 make test_container_no_lint"
|
||||
@echo ""
|
||||
|
||||
@@ -379,7 +379,6 @@ test_no_lint:
|
||||
done; \
|
||||
$(_PYTHON_VENV) -m pytest $(REPORT_ARG) $(TEST_PATHS) $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
|
||||
-
|
||||
test: lint test_no_lint
|
||||
|
||||
# container images act like a cache so that dependencies can only be downloaded once
|
||||
@@ -416,7 +415,7 @@ lint_container:
|
||||
@_TEST_CONT_TARGET="lint" $(MAKE) test_container
|
||||
|
||||
lint_container_all:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) lint_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -426,9 +425,9 @@ lint_container_all:
|
||||
# because e.g RHEL8 to RHEL9 IPU must work on python3.6 and python3.9.
|
||||
test_container:
|
||||
@case $(_TEST_CONTAINER) in \
|
||||
- f34) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.f34"; \
|
||||
- export _VENV="python3.9"; \
|
||||
+ f42) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.f42"; \
|
||||
+ export _VENV="python3.13"; \
|
||||
;; \
|
||||
rhel8) \
|
||||
export CONT_FILE="utils/container-tests/Containerfile.rhel8"; \
|
||||
@@ -439,7 +438,7 @@ test_container:
|
||||
export _VENV="python3.9"; \
|
||||
;; \
|
||||
*) \
|
||||
- echo "Error: Available containers are: f34, rhel8, rhel9"; exit 1; \
|
||||
+ echo "Error: Available containers are: f42, rhel8, rhel9"; exit 1; \
|
||||
;; \
|
||||
esac; \
|
||||
export TEST_IMAGE="leapp-repo-tests-$(_TEST_CONTAINER)"; \
|
||||
@@ -471,7 +470,7 @@ test_container:
|
||||
exit $$res
|
||||
|
||||
test_container_all:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -479,13 +478,13 @@ test_container_no_lint:
|
||||
@_TEST_CONT_TARGET="test_no_lint" $(MAKE) test_container
|
||||
|
||||
test_container_all_no_lint:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container_no_lint || exit 1; \
|
||||
done
|
||||
|
||||
# clean all testing and building containers and their images
|
||||
clean_containers:
|
||||
- @for i in "leapp-repo-tests-f34" "leapp-repo-tests-rhel8" \
|
||||
+ @for i in "leapp-repo-tests-f42" "leapp-repo-tests-rhel8" \
|
||||
"leapp-repo-tests-rhel9" "leapp-repo-build-el8"; do \
|
||||
$(_CONTAINER_TOOL) kill "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rm "$$i-cont" || :; \
|
||||
diff --git a/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py b/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
index 5302cdd2..c1cefc37 100644
|
||||
--- a/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
+++ b/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
@@ -6,7 +6,7 @@ import pytest
|
||||
|
||||
@pytest.mark.skipif(os.getuid() != 0, reason='User is not a root')
|
||||
@pytest.mark.skipif(
|
||||
- distro.linux_distribution()[0] == 'Fedora',
|
||||
+ distro.id() == 'fedora',
|
||||
reason='default.target.wants does not exists on Fedora distro',
|
||||
)
|
||||
def test_create_resume_service(current_actor_context):
|
||||
diff --git a/utils/container-tests/Containerfile.f34 b/utils/container-tests/Containerfile.f42
|
||||
similarity index 84%
|
||||
rename from utils/container-tests/Containerfile.f34
|
||||
rename to utils/container-tests/Containerfile.f42
|
||||
index a9346635..46f0f63a 100644
|
||||
--- a/utils/container-tests/Containerfile.f34
|
||||
+++ b/utils/container-tests/Containerfile.f42
|
||||
@@ -1,11 +1,11 @@
|
||||
-FROM fedora:34
|
||||
+FROM fedora:42
|
||||
|
||||
VOLUME /repo
|
||||
|
||||
RUN dnf update -y && \
|
||||
dnf install -y findutils make rsync python3-gobject-base NetworkManager-libnm
|
||||
|
||||
-ENV PYTHON_VENV python3.9
|
||||
+ENV PYTHON_VENV python3.13
|
||||
|
||||
COPY . /repocopy
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From db8d1f3fcc155b94b07d89d90eb82cd2a52d5cf9 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 20 Aug 2025 15:41:34 +0200
|
||||
Subject: [PATCH 07/55] networkmanagerconnectionscanner: Skip test on Python !=
|
||||
3.6
|
||||
|
||||
The test_nm_conn tests fails on at least Python >= 3.9 (not sure which
|
||||
version exactly).
|
||||
|
||||
Let's skip the test on Python != 3.6 as they never run on a different
|
||||
version - the actor is in the el8toel9 repo and is in FactsPhase.
|
||||
---
|
||||
.../unit_test_networkmanagerconnectionscanner.py | 12 +++++++++++-
|
||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py b/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
index 46af07c1..7558b307 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
@@ -1,4 +1,5 @@
|
||||
import errno
|
||||
+import sys
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
@@ -57,7 +58,16 @@ def test_no_conf(monkeypatch):
|
||||
assert not api.produce.called
|
||||
|
||||
|
||||
-@pytest.mark.skipif(not nmconnscanner.libnm_available, reason="NetworkManager g-ir not installed")
|
||||
+@pytest.mark.skipif(
|
||||
+ sys.version_info.major != 3 or sys.version_info.minor != 6,
|
||||
+ # On Python > 3.6 the GLib and NM libraries apparently behave differently and
|
||||
+ # the test fails. Let's skip it since the actor it's only ever run with
|
||||
+ # Python3.6 (el8toel9 repo and FactsPhase)
|
||||
+ reason="Only runs on Python 3.6",
|
||||
+)
|
||||
+@pytest.mark.skipif(
|
||||
+ not nmconnscanner.libnm_available, reason="NetworkManager g-ir not installed"
|
||||
+)
|
||||
def test_nm_conn(monkeypatch):
|
||||
"""
|
||||
Check a basic keyfile
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,132 +0,0 @@
|
||||
From c4c36a2abd0c83b021a20a450e66b8b1fe7be2da Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 27 Aug 2025 20:02:46 +0200
|
||||
Subject: [PATCH 08/55] Remove unused (rh)el7 Containerfiles
|
||||
|
||||
---
|
||||
utils/container-builds/Containerfile.centos7 | 15 -----------
|
||||
utils/container-tests/Containerfile.rhel7 | 24 ------------------
|
||||
utils/container-tests/Containerfile.ubi7 | 25 -------------------
|
||||
utils/container-tests/Containerfile.ubi7-lint | 25 -------------------
|
||||
4 files changed, 89 deletions(-)
|
||||
delete mode 100644 utils/container-builds/Containerfile.centos7
|
||||
delete mode 100644 utils/container-tests/Containerfile.rhel7
|
||||
delete mode 100644 utils/container-tests/Containerfile.ubi7
|
||||
delete mode 100644 utils/container-tests/Containerfile.ubi7-lint
|
||||
|
||||
diff --git a/utils/container-builds/Containerfile.centos7 b/utils/container-builds/Containerfile.centos7
|
||||
deleted file mode 100644
|
||||
index af00eddb..00000000
|
||||
--- a/utils/container-builds/Containerfile.centos7
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
-FROM centos:7
|
||||
-
|
||||
-VOLUME /repo
|
||||
-
|
||||
-# mirror.centos.org is dead, comment out mirrorlist and set baseurl to vault.centos.org
|
||||
-RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install -y rpm-build python-devel make git
|
||||
-
|
||||
-WORKDIR /repo
|
||||
-ENV DIST_VERSION 7
|
||||
-ENTRYPOINT make _build_local
|
||||
diff --git a/utils/container-tests/Containerfile.rhel7 b/utils/container-tests/Containerfile.rhel7
|
||||
deleted file mode 100644
|
||||
index 0a0c384a..00000000
|
||||
--- a/utils/container-tests/Containerfile.rhel7
|
||||
+++ /dev/null
|
||||
@@ -1,24 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /repo
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install -y python-virtualenv python-setuptools make git rsync
|
||||
-
|
||||
-# see ./Containerfile.ubi7 for explanation
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-ENV PYTHON_VENV python2.7
|
||||
-
|
||||
-COPY . /repocopy
|
||||
-
|
||||
-WORKDIR /repocopy
|
||||
-
|
||||
-RUN rm -rf tut*
|
||||
-
|
||||
-RUN make clean && make install-deps
|
||||
-
|
||||
-WORKDIR /
|
||||
-
|
||||
diff --git a/utils/container-tests/Containerfile.ubi7 b/utils/container-tests/Containerfile.ubi7
|
||||
deleted file mode 100644
|
||||
index 44625a76..00000000
|
||||
--- a/utils/container-tests/Containerfile.ubi7
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /payload
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install python-virtualenv python-setuptools make git -y
|
||||
-
|
||||
-# NOTE(ivasilev,pstodulk) We need at least pip v10.0.1, however centos:7
|
||||
-# provides just v8.1.2 (via EPEL). So do this: install epel repos -> install
|
||||
-# python2-pip -> use pip to update to specific pip version we require. period
|
||||
-# NOTE(pstodulk) I see we take care about pip for py3 inside the Makefile,
|
||||
-# however I am afraid of additional possible troubles in future because of the
|
||||
-# archaic pip3 version (v9.0.1). As we want to run tests for Py2 and Py3 in ci
|
||||
-# always anyway, let's put py3 installation here as well..
|
||||
-# Dropped Python3 as it is now added in its own container on RHEL8
|
||||
-
|
||||
-# This is some trickery: We install python27-python-pip from the scl, use the scl to bootstrap the python
|
||||
-# module of pip version 20.3.0 and then make it update to 20.3.4 resulting the 'pip' command to be available.
|
||||
-# The --target approach doesn't add it, but at least we now have pip 20.3.4 installed ;-)
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-WORKDIR /payload
|
||||
-ENTRYPOINT make install-deps && make test_no_lint
|
||||
diff --git a/utils/container-tests/Containerfile.ubi7-lint b/utils/container-tests/Containerfile.ubi7-lint
|
||||
deleted file mode 100644
|
||||
index ed548985..00000000
|
||||
--- a/utils/container-tests/Containerfile.ubi7-lint
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /payload
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install python-virtualenv python-setuptools make git -y
|
||||
-
|
||||
-# NOTE(ivasilev,pstodulk) We need at least pip v10.0.1, however centos:7
|
||||
-# provides just v8.1.2 (via EPEL). So do this: install epel repos -> install
|
||||
-# python2-pip -> use pip to update to specific pip version we require. period
|
||||
-# NOTE(pstodulk) I see we take care about pip for py3 inside the Makefile,
|
||||
-# however I am afraid of additional possible troubles in future because of the
|
||||
-# archaic pip3 version (v9.0.1). As we want to run tests for Py2 and Py3 in ci
|
||||
-# always anyway, let's put py3 installation here as well..
|
||||
-# Dropped Python3 as it is now added in its own container on RHEL8
|
||||
-
|
||||
-# This is some trickery: We install python27-python-pip from the scl, use the scl to bootstrap the python
|
||||
-# module of pip version 20.3.0 and then make it update to 20.3.4 resulting the 'pip' command to be available.
|
||||
-# The --target approach doesn't add it, but at least we now have pip 20.3.4 installed ;-)
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-WORKDIR /payload
|
||||
-ENTRYPOINT make install-deps && make lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,239 +0,0 @@
|
||||
From 29c7619f0368384dd2e266610098a1f8d7a13813 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 27 Aug 2025 20:04:28 +0200
|
||||
Subject: [PATCH 09/55] Rename Containerfiles to consistent names
|
||||
|
||||
The container files (both those used in CI and locally by the Makefile)
|
||||
and both build and test, use various base containers - Centos, UBIs.
|
||||
|
||||
This patch unifies the naming scheme to Containerfile.elX to avoid
|
||||
making the user remember which one is used by which command an at
|
||||
which version.
|
||||
|
||||
The containerfiles used by Github Actions are moved to separate
|
||||
folder to avoid name clashes.
|
||||
|
||||
Also, in the GitHub actions test workflow the
|
||||
--security-opt=seccomp=unconfined is removed. Not sure why it was set in
|
||||
the first place, but seems it's not needed anymore.
|
||||
---
|
||||
.github/workflows/unit-tests.yml | 24 ++++++++------
|
||||
Makefile | 31 +++++++++----------
|
||||
.../{Containerfile.ubi8 => Containerfile.el8} | 0
|
||||
.../{Containerfile.ubi9 => Containerfile.el9} | 0
|
||||
...{Containerfile.rhel8 => Containerfile.el8} | 0
|
||||
...{Containerfile.rhel9 => Containerfile.el9} | 0
|
||||
.../Containerfile.el8} | 0
|
||||
.../Containerfile.el8-lint} | 0
|
||||
.../Containerfile.el9} | 0
|
||||
.../Containerfile.el9-lint} | 0
|
||||
10 files changed, 30 insertions(+), 25 deletions(-)
|
||||
rename utils/container-builds/{Containerfile.ubi8 => Containerfile.el8} (100%)
|
||||
rename utils/container-builds/{Containerfile.ubi9 => Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.rhel8 => Containerfile.el8} (100%)
|
||||
rename utils/container-tests/{Containerfile.rhel9 => Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi8 => ci/Containerfile.el8} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi8-lint => ci/Containerfile.el8-lint} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi9 => ci/Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi9-lint => ci/Containerfile.el9-lint} (100%)
|
||||
|
||||
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
|
||||
index ed82e0e5..cfcec437 100644
|
||||
--- a/.github/workflows/unit-tests.yml
|
||||
+++ b/.github/workflows/unit-tests.yml
|
||||
@@ -19,36 +19,36 @@ jobs:
|
||||
- name: 'Unit tests (python:3.12; repos:el9toel10,common)'
|
||||
python: python3.12
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.12; repos:el9toel10,common)'
|
||||
python: python3.12
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
- name: 'Unit tests (python:3.9; repos:el9toel10,common)'
|
||||
python: python3.9
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.9; repos:el9toel10,common)'
|
||||
python: python3.9
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
# 8to9
|
||||
- name: 'Unit tests (python:3.9; repos:el8toel9,common)'
|
||||
python: python3.9
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.9; repos:el8toel9,common)'
|
||||
python: python3.9
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
- name: 'Unit tests (python:3.6; repos:el8toel9,common)'
|
||||
python: python3.6
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi8
|
||||
+ container: el8
|
||||
- name: 'Linters (python:3.6; repos:el8toel9,common)'
|
||||
python: python3.6
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi8-lint
|
||||
+ container: el8-lint
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -63,4 +63,10 @@ jobs:
|
||||
run: |
|
||||
git branch -f main origin/main
|
||||
- name: ${{matrix.scenarios.name}}
|
||||
- run: script -e -c /bin/bash -c 'TERM=xterm podman build --security-opt=seccomp=unconfined -t leapp-tests -f utils/container-tests/Containerfile.${{matrix.scenarios.container}} utils/container-tests && PYTHON_VENV=${{matrix.scenarios.python}} REPOSITORIES=${{matrix.scenarios.repos}} podman run --security-opt=seccomp=unconfined --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV --env=REPOSITORIES leapp-tests'
|
||||
+ run: |
|
||||
+ script -e -c /bin/bash -c \
|
||||
+ 'TERM=xterm \
|
||||
+ podman build -t leapp-tests -f utils/container-tests/ci/Containerfile.${{matrix.scenarios.container}} . && \
|
||||
+ PYTHON_VENV=${{matrix.scenarios.python}} \
|
||||
+ REPOSITORIES=${{matrix.scenarios.repos}} \
|
||||
+ podman run --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV --env=REPOSITORIES leapp-tests'
|
||||
diff --git a/Makefile b/Makefile
|
||||
index e0fc7e00..754c2c63 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -51,7 +51,7 @@ _COPR_CONFIG=$${COPR_CONFIG:-~/.config/copr_rh_oamg.conf}
|
||||
_CONTAINER_TOOL=$${CONTAINER_TOOL:-podman}
|
||||
|
||||
# container to run tests in
|
||||
-_TEST_CONTAINER=$${TEST_CONTAINER:-rhel8}
|
||||
+_TEST_CONTAINER=$${TEST_CONTAINER:-el8}
|
||||
|
||||
# In case just specific CHROOTs should be used for the COPR build, you can
|
||||
# set the multiple CHROOTs separated by comma in the COPR_CHROOT envar, e.g.
|
||||
@@ -129,7 +129,7 @@ help:
|
||||
@echo " test lint source code and run tests"
|
||||
@echo " test_no_lint run tests without linting the source code"
|
||||
@echo " test_container run lint and tests in container"
|
||||
- @echo " - default container is 'rhel8'"
|
||||
+ @echo " - default container is 'el8'"
|
||||
@echo " - can be changed by setting TEST_CONTAINER env"
|
||||
@echo " test_container_all run lint and tests in all available containers"
|
||||
@echo " test_container_no_lint run tests without linting in container, see test_container"
|
||||
@@ -164,9 +164,9 @@ help:
|
||||
@echo " PR=7 SUFFIX='my_additional_suffix' make <target>"
|
||||
@echo " MR=6 COPR_CONFIG='path/to/the/config/copr/file' make <target>"
|
||||
@echo " ACTOR=<actor> TEST_LIBS=y make test"
|
||||
- @echo " BUILD_CONTAINER=rhel8 make build_container"
|
||||
+ @echo " BUILD_CONTAINER=el8 make build_container"
|
||||
@echo " TEST_CONTAINER=f42 make test_container"
|
||||
- @echo " CONTAINER_TOOL=docker TEST_CONTAINER=rhel8 make test_container_no_lint"
|
||||
+ @echo " CONTAINER_TOOL=docker TEST_CONTAINER=el8 make test_container_no_lint"
|
||||
@echo ""
|
||||
|
||||
clean:
|
||||
@@ -252,10 +252,10 @@ build_container:
|
||||
echo "--- Build RPM ${PKGNAME}-${VERSION}-${RELEASE}.el$(DIST_VERSION).rpm in container ---";
|
||||
case "$(BUILD_CONTAINER)" in \
|
||||
el8) \
|
||||
- CONT_FILE="utils/container-builds/Containerfile.ubi8"; \
|
||||
+ CONT_FILE="utils/container-builds/Containerfile.el8"; \
|
||||
;; \
|
||||
el9) \
|
||||
- CONT_FILE="utils/container-builds/Containerfile.ubi9"; \
|
||||
+ CONT_FILE="utils/container-builds/Containerfile.el9"; \
|
||||
;; \
|
||||
"") \
|
||||
echo "BUILD_CONTAINER must be set"; \
|
||||
@@ -415,7 +415,7 @@ lint_container:
|
||||
@_TEST_CONT_TARGET="lint" $(MAKE) test_container
|
||||
|
||||
lint_container_all:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in f42 el{8,9}; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) lint_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -429,16 +429,16 @@ test_container:
|
||||
export CONT_FILE="utils/container-tests/Containerfile.f42"; \
|
||||
export _VENV="python3.13"; \
|
||||
;; \
|
||||
- rhel8) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.rhel8"; \
|
||||
+ el8) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.el8"; \
|
||||
export _VENV="python3.6"; \
|
||||
;; \
|
||||
- rhel9) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.rhel9"; \
|
||||
+ el9) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.el9"; \
|
||||
export _VENV="python3.9"; \
|
||||
;; \
|
||||
*) \
|
||||
- echo "Error: Available containers are: f42, rhel8, rhel9"; exit 1; \
|
||||
+ echo "Error: Available containers are: f42, el8, el9"; exit 1; \
|
||||
;; \
|
||||
esac; \
|
||||
export TEST_IMAGE="leapp-repo-tests-$(_TEST_CONTAINER)"; \
|
||||
@@ -470,7 +470,7 @@ test_container:
|
||||
exit $$res
|
||||
|
||||
test_container_all:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "el8" "el9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -478,14 +478,13 @@ test_container_no_lint:
|
||||
@_TEST_CONT_TARGET="test_no_lint" $(MAKE) test_container
|
||||
|
||||
test_container_all_no_lint:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in f42 el{8,9}; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container_no_lint || exit 1; \
|
||||
done
|
||||
|
||||
# clean all testing and building containers and their images
|
||||
clean_containers:
|
||||
- @for i in "leapp-repo-tests-f42" "leapp-repo-tests-rhel8" \
|
||||
- "leapp-repo-tests-rhel9" "leapp-repo-build-el8"; do \
|
||||
+ @for i in leapp-repo-tests-f42 leapp-repo-tests-el{8,9} leapp-repo-build-el{8,9}; do \
|
||||
$(_CONTAINER_TOOL) kill "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rm "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rmi "$$i" || :; \
|
||||
diff --git a/utils/container-builds/Containerfile.ubi8 b/utils/container-builds/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-builds/Containerfile.ubi8
|
||||
rename to utils/container-builds/Containerfile.el8
|
||||
diff --git a/utils/container-builds/Containerfile.ubi9 b/utils/container-builds/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-builds/Containerfile.ubi9
|
||||
rename to utils/container-builds/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.rhel8 b/utils/container-tests/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.rhel8
|
||||
rename to utils/container-tests/Containerfile.el8
|
||||
diff --git a/utils/container-tests/Containerfile.rhel9 b/utils/container-tests/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.rhel9
|
||||
rename to utils/container-tests/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.ubi8 b/utils/container-tests/ci/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi8
|
||||
rename to utils/container-tests/ci/Containerfile.el8
|
||||
diff --git a/utils/container-tests/Containerfile.ubi8-lint b/utils/container-tests/ci/Containerfile.el8-lint
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi8-lint
|
||||
rename to utils/container-tests/ci/Containerfile.el8-lint
|
||||
diff --git a/utils/container-tests/Containerfile.ubi9 b/utils/container-tests/ci/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi9
|
||||
rename to utils/container-tests/ci/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.ubi9-lint b/utils/container-tests/ci/Containerfile.el9-lint
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi9-lint
|
||||
rename to utils/container-tests/ci/Containerfile.el9-lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
From 17767238d038d36341181e1702b73681ae432439 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 20 Aug 2025 14:12:13 +0200
|
||||
Subject: [PATCH 10/55] Replace ubi:8 containers with centos:8
|
||||
|
||||
The networkmanagerconnectionscanner depends on NetworkManager-nmlib and
|
||||
python3-gobject. These are not available in the UBI 8 repos and the
|
||||
tests are skipped.
|
||||
|
||||
This patch changes the base container from UBI 8 to Centos 8 which has
|
||||
the packages available and the tests are not skipped.
|
||||
---
|
||||
commands/tests/test_upgrade_paths.py | 5 +++++
|
||||
utils/container-tests/Containerfile.el8 | 10 ++++++++--
|
||||
utils/container-tests/ci/Containerfile.el8 | 10 ++++++++--
|
||||
3 files changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/commands/tests/test_upgrade_paths.py b/commands/tests/test_upgrade_paths.py
|
||||
index 89b5eb71..9bdf5792 100644
|
||||
--- a/commands/tests/test_upgrade_paths.py
|
||||
+++ b/commands/tests/test_upgrade_paths.py
|
||||
@@ -42,6 +42,11 @@ def test_get_target_version(mock_open, monkeypatch):
|
||||
},
|
||||
)
|
||||
def test_get_target_release(mock_open, monkeypatch): # do not remove mock_open
|
||||
+ # Make it look like it's RHEL even on centos, because that's what the test
|
||||
+ # assumes.
|
||||
+ # Otherwise the test, when ran on Centos, fails because it works
|
||||
+ # with MAJOR.MINOR version format while Centos uses MAJOR format.
|
||||
+ monkeypatch.setattr(command_utils, 'get_distro_id', lambda: 'rhel')
|
||||
monkeypatch.setattr(command_utils, 'get_os_release_version_id', lambda x: '8.6')
|
||||
|
||||
# make sure env var LEAPP_DEVEL_TARGET_RELEASE takes precedence
|
||||
diff --git a/utils/container-tests/Containerfile.el8 b/utils/container-tests/Containerfile.el8
|
||||
index 6f21839b..b92e8742 100644
|
||||
--- a/utils/container-tests/Containerfile.el8
|
||||
+++ b/utils/container-tests/Containerfile.el8
|
||||
@@ -1,9 +1,15 @@
|
||||
-FROM registry.access.redhat.com/ubi8/ubi:latest
|
||||
+FROM centos:8
|
||||
+
|
||||
+RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
|
||||
VOLUME /repo
|
||||
|
||||
RUN dnf update -y && \
|
||||
- dnf install -y python3-virtualenv python3-setuptools python3-pip make git rsync
|
||||
+ dnf install -y git make rsync \
|
||||
+ python3-virtualenv python3-setuptools python3-pip \
|
||||
+ python3-gobject NetworkManager-libnm
|
||||
|
||||
ENV PYTHON_VENV python3.6
|
||||
|
||||
diff --git a/utils/container-tests/ci/Containerfile.el8 b/utils/container-tests/ci/Containerfile.el8
|
||||
index 4da60c18..4a19092e 100644
|
||||
--- a/utils/container-tests/ci/Containerfile.el8
|
||||
+++ b/utils/container-tests/ci/Containerfile.el8
|
||||
@@ -1,9 +1,15 @@
|
||||
-FROM registry.access.redhat.com/ubi8/ubi:latest
|
||||
+FROM centos:8
|
||||
+
|
||||
+RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
|
||||
VOLUME /payload
|
||||
|
||||
RUN dnf update -y && \
|
||||
- dnf install python3-virtualenv python3-setuptools python3-pip make git -y
|
||||
+ dnf install -y make git \
|
||||
+ python3-virtualenv python3-setuptools python3-pip \
|
||||
+ python3-gobject NetworkManager-libnm
|
||||
|
||||
WORKDIR /payload
|
||||
ENTRYPOINT make install-deps && make test_no_lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
From c4f3ace1ebb909dc53796e16959a2459a15d9d74 Mon Sep 17 00:00:00 2001
|
||||
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Date: Thu, 9 Oct 2025 13:30:16 +0000
|
||||
Subject: [PATCH 11/55] chore(deps): update actions/checkout action to v5
|
||||
|
||||
---
|
||||
.github/workflows/codespell.yml | 2 +-
|
||||
.github/workflows/differential-shellcheck.yml | 2 +-
|
||||
.github/workflows/unit-tests.yml | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml
|
||||
index 3e595e32..4b07e4b3 100644
|
||||
--- a/.github/workflows/codespell.yml
|
||||
+++ b/.github/workflows/codespell.yml
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- - uses: actions/checkout@v4
|
||||
+ - uses: actions/checkout@v5
|
||||
- uses: codespell-project/actions-codespell@v2
|
||||
with:
|
||||
ignore_words_list: ro,fo,couldn,repositor,zeor,bootup
|
||||
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml
|
||||
index e1bafb93..6c81713c 100644
|
||||
--- a/.github/workflows/differential-shellcheck.yml
|
||||
+++ b/.github/workflows/differential-shellcheck.yml
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Repository checkout
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
|
||||
index cfcec437..d1b8fb2a 100644
|
||||
--- a/.github/workflows/unit-tests.yml
|
||||
+++ b/.github/workflows/unit-tests.yml
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@v5
|
||||
with:
|
||||
# NOTE(ivasilev) fetch-depth 0 is critical here as leapp deps discovery depends on specific substring in
|
||||
# commit message and default 1 option will get us just merge commit which has an unrelevant message.
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From 601c26f795a7b2f6cb553c656112235d17137b8f Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 16 Sep 2025 15:58:29 +0200
|
||||
Subject: [PATCH 12/55] LiveMode: Add /etc/crypttab file to the target
|
||||
userspace container
|
||||
|
||||
When upgrading with LiveMode, the auto-unlock of encrypted devices
|
||||
fails because the /etc/crypttab configuration file is not present inside
|
||||
the squashfs, causing the boot process to fail.
|
||||
|
||||
This change copy /etc/crypttab file to the target userspace container
|
||||
during the upgrade process, allowing encrypted devices to be properly
|
||||
unlocked.
|
||||
|
||||
Jira: RHEL-90098
|
||||
---
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index 57a94e9d..aac171a7 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -3,6 +3,7 @@ from leapp.libraries.common.config.version import get_source_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CephInfo,
|
||||
+ CopyFile,
|
||||
DracutModule,
|
||||
LuksDumps,
|
||||
StorageInfo,
|
||||
@@ -156,7 +157,10 @@ def check_invalid_luks_devices():
|
||||
'tpm2-tools',
|
||||
'tpm2-abrmd'
|
||||
]
|
||||
- api.produce(TargetUserSpaceUpgradeTasks(install_rpms=required_crypt_rpms))
|
||||
+ api.produce(TargetUserSpaceUpgradeTasks(
|
||||
+ copy_files=[CopyFile(src="/etc/crypttab")],
|
||||
+ install_rpms=required_crypt_rpms)
|
||||
+ )
|
||||
api.produce(UpgradeInitramfsTasks(include_dracut_modules=[
|
||||
DracutModule(name='clevis'),
|
||||
DracutModule(name='clevis-pin-tpm2')
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
From ae048a890ddd2169f3f46d9fbd1545fd65670e16 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 6 Oct 2025 15:56:16 +0200
|
||||
Subject: [PATCH 13/55] livemode: Include /etc/crypttab in upgrade initramfs
|
||||
|
||||
The /etc/crypttab file is sometimes not picked up automatically by
|
||||
dracut, this change includes it unconditionally. This is required for
|
||||
auto-unlocking encrypted devices in upgrade environment.
|
||||
|
||||
The upgradeinitramfsgenerator is modified to process
|
||||
UpgradeInitramfsTasksinclude's include_files when upgrading in livemode.
|
||||
|
||||
Jira: RHEL-90098
|
||||
---
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 4 +++-
|
||||
.../libraries/upgradeinitramfsgenerator.py | 3 +++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index aac171a7..d52b9e73 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -161,7 +161,9 @@ def check_invalid_luks_devices():
|
||||
copy_files=[CopyFile(src="/etc/crypttab")],
|
||||
install_rpms=required_crypt_rpms)
|
||||
)
|
||||
- api.produce(UpgradeInitramfsTasks(include_dracut_modules=[
|
||||
+ api.produce(UpgradeInitramfsTasks(
|
||||
+ include_files=['/etc/crypttab'],
|
||||
+ include_dracut_modules=[
|
||||
DracutModule(name='clevis'),
|
||||
DracutModule(name='clevis-pin-tpm2')
|
||||
])
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
index 02c3fd9d..3ad92167 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
@@ -436,6 +436,9 @@ def _generate_livemode_initramfs(context, userspace_initramfs_dest, target_kerne
|
||||
'--lvmconf', '--mdadmconf',
|
||||
'--kver', target_kernel_ver, '-f', userspace_initramfs_dest]
|
||||
|
||||
+ # Add included files
|
||||
+ cmd.extend(itertools.chain(*(('--install', file) for file in initramfs_includes.files)))
|
||||
+
|
||||
# Add dracut modules
|
||||
cmd.extend(itertools.chain(*(('--add', module) for module in dracut_modules)))
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 8248f6afd54bedcfe9d9d639fda3760669360dbe Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 13 Oct 2025 13:39:14 +0200
|
||||
Subject: [PATCH 14/55] overlaygen: Fix not enough arguments for format string
|
||||
|
||||
---
|
||||
repos/system_upgrade/common/libraries/overlaygen.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index 867e3559..a048af2b 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -710,7 +710,7 @@ def _create_mount_disk_image_old(disk_images_directory, path):
|
||||
try:
|
||||
utils.call_with_oserror_handled(cmd=['/sbin/mkfs.ext4', '-F', diskimage_path])
|
||||
except CalledProcessError as e:
|
||||
- api.current_logger().error('Failed to create ext4 filesystem in %s', exc_info=True)
|
||||
+ api.current_logger().error('Failed to create ext4 filesystem in %s', diskimage_path, exc_info=True)
|
||||
raise StopActorExecutionError(
|
||||
message=str(e)
|
||||
)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,444 +0,0 @@
|
||||
From 546d18f64deabe8440ac6d4ee707d7a5b69415db Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 15 Sep 2025 11:09:59 +0200
|
||||
Subject: [PATCH 15/55] Generalize TargetRepositories
|
||||
|
||||
The RHELTargetRepository model is deprecated and replaced by the
|
||||
DistroTargetRepository. The target TargetRepositories model is updated
|
||||
accordingly.
|
||||
|
||||
TargetRepositories.rhel_repos are only filled on RHEL.
|
||||
---
|
||||
.../libraries/checktargetrepos.py | 4 ++-
|
||||
.../tests/test_checktargetrepos.py | 32 +++++++++++++------
|
||||
.../cloud/checkrhui/libraries/checkrhui.py | 5 ++-
|
||||
.../tests/component_test_checkrhui.py | 1 +
|
||||
.../libraries/setuptargetrepos.py | 29 +++++++++++------
|
||||
.../libraries/setuptargetrepos_repomap.py | 4 +--
|
||||
.../tests/test_setuptargetrepos.py | 22 ++++++++++---
|
||||
.../libraries/userspacegen.py | 2 ++
|
||||
.../tests/unit_test_targetuserspacecreator.py | 7 ++++
|
||||
.../common/models/targetrepositories.py | 32 +++++++++++++++++--
|
||||
10 files changed, 107 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
index c286ed4f..141cf8e4 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
@@ -2,12 +2,14 @@ from leapp import reporting
|
||||
from leapp.libraries.common import config, rhsm
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
-from leapp.models import CustomTargetRepositoryFile, RHUIInfo, TargetRepositories
|
||||
+from leapp.models import CustomTargetRepositoryFile, RHELTargetRepository, RHUIInfo, TargetRepositories
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
# TODO: we need to provide this path in a shared library
|
||||
CUSTOM_REPO_PATH = '/etc/leapp/files/leapp_upgrade_repositories.repo'
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def _any_custom_repo_defined():
|
||||
for tr in api.consume(TargetRepositories):
|
||||
if tr.custom_repos:
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
index c1ca8cd1..ea93ce7e 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
@@ -8,12 +8,11 @@ from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
CustomTargetRepositoryFile,
|
||||
- EnvVar,
|
||||
- Report,
|
||||
- RepositoryData,
|
||||
+ DistroTargetRepository,
|
||||
RHELTargetRepository,
|
||||
TargetRepositories
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
from leapp.utils.report import is_inhibitor
|
||||
|
||||
|
||||
@@ -32,11 +31,21 @@ class MockedConsume(object):
|
||||
return iter([msg for msg in self._msgs if isinstance(msg, model)])
|
||||
|
||||
|
||||
-_RHEL_REPOS = [
|
||||
- RHELTargetRepository(repoid='repo1'),
|
||||
- RHELTargetRepository(repoid='repo2'),
|
||||
- RHELTargetRepository(repoid='repo3'),
|
||||
- RHELTargetRepository(repoid='repo4'),
|
||||
+@suppress_deprecation(RHELTargetRepository)
|
||||
+def _test_rhel_repos():
|
||||
+ return [
|
||||
+ RHELTargetRepository(repoid='repo1'),
|
||||
+ RHELTargetRepository(repoid='repo2'),
|
||||
+ RHELTargetRepository(repoid='repo3'),
|
||||
+ RHELTargetRepository(repoid='repo4'),
|
||||
+ ]
|
||||
+
|
||||
+
|
||||
+_DISTRO_REPOS = [
|
||||
+ DistroTargetRepository(repoid='repo1'),
|
||||
+ DistroTargetRepository(repoid='repo2'),
|
||||
+ DistroTargetRepository(repoid='repo3'),
|
||||
+ DistroTargetRepository(repoid='repo4'),
|
||||
]
|
||||
|
||||
_CUSTOM_REPOS = [
|
||||
@@ -46,8 +55,10 @@ _CUSTOM_REPOS = [
|
||||
CustomTargetRepository(repoid='repo4', name='repo4name', baseurl=None, enabled=True),
|
||||
]
|
||||
|
||||
-_TARGET_REPOS_CUSTOM = TargetRepositories(rhel_repos=_RHEL_REPOS, custom_repos=_CUSTOM_REPOS)
|
||||
-_TARGET_REPOS_NO_CUSTOM = TargetRepositories(rhel_repos=_RHEL_REPOS)
|
||||
+_TARGET_REPOS_CUSTOM = TargetRepositories(
|
||||
+ rhel_repos=_test_rhel_repos(), distro_repos=_DISTRO_REPOS, custom_repos=_CUSTOM_REPOS
|
||||
+)
|
||||
+_TARGET_REPOS_NO_CUSTOM = TargetRepositories(rhel_repos=_test_rhel_repos(), distro_repos=_DISTRO_REPOS)
|
||||
_CUSTOM_TARGET_REPOFILE = CustomTargetRepositoryFile(file='/etc/leapp/files/leapp_upgrade_repositories.repo')
|
||||
|
||||
|
||||
@@ -55,6 +66,7 @@ def test_checktargetrepos_rhsm(monkeypatch):
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: False)
|
||||
monkeypatch.setattr(api, 'consume', MockedConsume())
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(checktargetrepos, 'get_target_major_version', lambda: '8')
|
||||
checktargetrepos.process()
|
||||
assert reporting.create_report.called == 0
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
index ea154173..5dcdd967 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
@@ -22,6 +22,7 @@ from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
DNFPluginTask,
|
||||
InstalledRPM,
|
||||
+ RHELTargetRepository,
|
||||
RHUIInfo,
|
||||
RpmTransactionTasks,
|
||||
TargetRepositories,
|
||||
@@ -30,6 +31,7 @@ from leapp.models import (
|
||||
TargetRHUISetupInfo,
|
||||
TargetUserSpacePreupgradeTasks
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
MatchingSetup = namedtuple('MatchingSetup', ['family', 'description'])
|
||||
|
||||
@@ -370,11 +372,12 @@ def emit_rhui_setup_tasks_based_on_config(rhui_config_dict):
|
||||
api.produce(rhui_info)
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def request_configured_repos_to_be_enabled(rhui_config):
|
||||
config_repos_to_enable = rhui_config[RhuiTargetRepositoriesToUse.name]
|
||||
custom_repos = [CustomTargetRepository(repoid=repoid) for repoid in config_repos_to_enable]
|
||||
if custom_repos:
|
||||
- target_repos = TargetRepositories(custom_repos=custom_repos, rhel_repos=[])
|
||||
+ target_repos = TargetRepositories(custom_repos=custom_repos, rhel_repos=[], distro_repos=[])
|
||||
api.produce(target_repos)
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
index 3ac9c1b8..02ca352e 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
@@ -468,6 +468,7 @@ def test_request_configured_repos_to_be_enabled(monkeypatch):
|
||||
|
||||
target_repos = api.produce.model_instances[0]
|
||||
assert isinstance(target_repos, TargetRepositories)
|
||||
+ assert not target_repos.distro_repos
|
||||
assert not target_repos.rhel_repos
|
||||
|
||||
custom_repoids = sorted(custom_repo_model.repoid for custom_repo_model in target_repos.custom_repos)
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
index a6073aa3..9e5b1334 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
@@ -1,9 +1,10 @@
|
||||
-
|
||||
from leapp.libraries.actor import setuptargetrepos_repomap
|
||||
+from leapp.libraries.common.config import get_distro_id
|
||||
from leapp.libraries.common.config.version import get_source_major_version, get_source_version, get_target_version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
+ DistroTargetRepository,
|
||||
InstalledRPM,
|
||||
RepositoriesBlacklisted,
|
||||
RepositoriesFacts,
|
||||
@@ -15,6 +16,7 @@ from leapp.models import (
|
||||
TargetRepositories,
|
||||
UsedRepositories
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810 = {
|
||||
'rhui-microsoft-azure-rhel8-sapapps': 'rhui-microsoft-azure-rhel8-base-sap-apps',
|
||||
@@ -80,6 +82,7 @@ def _get_mapped_repoids(repomap, src_repoids):
|
||||
return mapped_repoids
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository)
|
||||
def process():
|
||||
# Load relevant data from messages
|
||||
used_repoids_dict = _get_used_repo_dict()
|
||||
@@ -103,10 +106,11 @@ def process():
|
||||
# installed packages that have mapping to prevent missing repositories that are disabled during the upgrade, but
|
||||
# can be used to upgrade installed packages.
|
||||
repoids_to_map = enabled_repoids.union(repoids_from_installed_packages_with_mapping)
|
||||
+ is_rhel = get_distro_id() == 'rhel'
|
||||
|
||||
# RHEL8.10 use a different repoid for client repository, but the repomapping mechanism cannot distinguish these
|
||||
# as it does not use minor versions. Therefore, we have to hardcode these changes.
|
||||
- if get_source_version() == '8.10':
|
||||
+ if is_rhel and get_source_version() == '8.10':
|
||||
for rhel88_rhui_client_repoid, rhel810_rhui_client_repoid in RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810.items():
|
||||
if rhel810_rhui_client_repoid in repoids_to_map:
|
||||
# Replace RHEL8.10 rhui client repoids with RHEL8.8 repoids,
|
||||
@@ -119,9 +123,9 @@ def process():
|
||||
default_channels = setuptargetrepos_repomap.get_default_repository_channels(repomap, repoids_to_map)
|
||||
repomap.set_default_channels(default_channels)
|
||||
|
||||
- # Get target RHEL repoids based on the repomap
|
||||
+ # Get target distro repoids based on the repomap
|
||||
expected_repos = repomap.get_expected_target_pesid_repos(repoids_to_map)
|
||||
- target_rhel_repoids = set()
|
||||
+ target_distro_repoids = set()
|
||||
for target_pesid, target_pesidrepo in expected_repos.items():
|
||||
if not target_pesidrepo:
|
||||
# NOTE this could happen only for enabled repositories part of the set,
|
||||
@@ -139,7 +143,7 @@ def process():
|
||||
if target_pesidrepo.repoid in excluded_repoids:
|
||||
api.current_logger().debug('Skipping the {} repo (excluded).'.format(target_pesidrepo.repoid))
|
||||
continue
|
||||
- target_rhel_repoids.add(target_pesidrepo.repoid)
|
||||
+ target_distro_repoids.add(target_pesidrepo.repoid)
|
||||
|
||||
# FIXME: this could possibly result into a try to enable multiple repositories
|
||||
# from the same family (pesid). But unless we have a bug in previous actors,
|
||||
@@ -151,7 +155,7 @@ def process():
|
||||
if repo in excluded_repoids:
|
||||
api.current_logger().debug('Skipping the {} repo from setup task (excluded).'.format(repo))
|
||||
continue
|
||||
- target_rhel_repoids.add(repo)
|
||||
+ target_distro_repoids.add(repo)
|
||||
|
||||
# On 8.10, some RHUI setups have different names than the one computed by repomapping.
|
||||
# Although such situation could be avoided (having another client repo when a single
|
||||
@@ -159,12 +163,16 @@ def process():
|
||||
# solution.
|
||||
if get_target_version() == '8.10':
|
||||
for pre_810_repoid, post_810_repoid in RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810.items():
|
||||
- if pre_810_repoid in target_rhel_repoids:
|
||||
- target_rhel_repoids.remove(pre_810_repoid)
|
||||
- target_rhel_repoids.add(post_810_repoid)
|
||||
+ if pre_810_repoid in target_distro_repoids:
|
||||
+ target_distro_repoids.remove(pre_810_repoid)
|
||||
+ target_distro_repoids.add(post_810_repoid)
|
||||
|
||||
# create the final lists and sort them (for easier testing)
|
||||
- rhel_repos = [RHELTargetRepository(repoid=repoid) for repoid in sorted(target_rhel_repoids)]
|
||||
+ if is_rhel:
|
||||
+ rhel_repos = [RHELTargetRepository(repoid=repoid) for repoid in sorted(target_distro_repoids)]
|
||||
+ else:
|
||||
+ rhel_repos = []
|
||||
+ distro_repos = [DistroTargetRepository(repoid=repoid) for repoid in sorted(target_distro_repoids)]
|
||||
custom_repos = [repo for repo in custom_repos if repo.repoid not in excluded_repoids]
|
||||
custom_repos = sorted(custom_repos, key=lambda x: x.repoid)
|
||||
|
||||
@@ -179,5 +187,6 @@ def process():
|
||||
|
||||
api.produce(TargetRepositories(
|
||||
rhel_repos=rhel_repos,
|
||||
+ distro_repos=distro_repos,
|
||||
custom_repos=custom_repos,
|
||||
))
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
index 37be03f1..343ee2ea 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-from leapp.libraries.common.config import get_target_product_channel
|
||||
+from leapp.libraries.common.config import get_distro_id, get_target_product_channel
|
||||
from leapp.libraries.common.config.version import get_source_major_version, get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
|
||||
@@ -44,7 +44,7 @@ class RepoMapDataHandler(object):
|
||||
# ideal for work, but there is not any significant impact..
|
||||
self.repositories = repo_map.repositories
|
||||
self.mapping = repo_map.mapping
|
||||
- self.distro = distro or api.current_actor().configuration.os_release.release_id
|
||||
+ self.distro = distro or get_distro_id()
|
||||
# FIXME(pstodulk): what about default_channel -> fallback_channel
|
||||
# hardcoded always as ga? instead of list of channels..
|
||||
# it'd be possibly confusing naming now...
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
index 1f898e8f..e4a30f7f 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
@@ -198,11 +198,23 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
setuptargetrepos.process()
|
||||
assert api.produce.called
|
||||
|
||||
+ distro_repos = api.produce.model_instances[0].distro_repos
|
||||
rhel_repos = api.produce.model_instances[0].rhel_repos
|
||||
- assert len(rhel_repos) == 3
|
||||
|
||||
+ assert len(distro_repos) == 3
|
||||
+
|
||||
+ produced_distro_repoids = {repo.repoid for repo in distro_repos}
|
||||
produced_rhel_repoids = {repo.repoid for repo in rhel_repos}
|
||||
- expected_rhel_repoids = {'{0}-8-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
- '{0}-8-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
- '{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id)}
|
||||
- assert produced_rhel_repoids == expected_rhel_repoids
|
||||
+
|
||||
+ expected_repoids = {
|
||||
+ "{0}-8-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
+ "{0}-8-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
+ "{0}-8-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
+ }
|
||||
+
|
||||
+ assert produced_distro_repoids == expected_repoids
|
||||
+ if distro_id == 'rhel':
|
||||
+ assert len(rhel_repos) == 3
|
||||
+ assert produced_rhel_repoids == expected_repoids
|
||||
+ else:
|
||||
+ assert len(rhel_repos) == 0
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 55877d05..407cb0b7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -17,6 +17,7 @@ from leapp.models import (
|
||||
CustomTargetRepositoryFile,
|
||||
PkgManagerInfo,
|
||||
RepositoriesFacts,
|
||||
+ RHELTargetRepository,
|
||||
RHSMInfo,
|
||||
RHUIInfo,
|
||||
StorageInfo,
|
||||
@@ -967,6 +968,7 @@ def _get_rh_available_repoids(context, indata):
|
||||
return rh_repoids
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def gather_target_repositories(context, indata):
|
||||
"""
|
||||
Get available required target repositories and inhibit or raise error if basic checks do not pass.
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 7853a7ad..f05e6bc2 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -1072,6 +1072,7 @@ def test_consume_data(monkeypatch, raised, no_rhsm, testdata):
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Currently not implemented in the actor. It's TODO.")
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories(monkeypatch):
|
||||
monkeypatch.setattr(userspacegen.api, 'current_actor', CurrentActorMocked())
|
||||
# The available RHSM repos
|
||||
@@ -1104,6 +1105,7 @@ def test_gather_target_repositories_none_available(monkeypatch):
|
||||
assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
|
||||
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories_rhui(monkeypatch):
|
||||
|
||||
indata = testInData(
|
||||
@@ -1122,6 +1124,10 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
rhel_repos=[
|
||||
models.RHELTargetRepository(repoid='rhui-1'),
|
||||
models.RHELTargetRepository(repoid='rhui-2')
|
||||
+ ],
|
||||
+ distro_repos=[
|
||||
+ models.DistroTargetRepository(repoid='rhui-1'),
|
||||
+ models.DistroTargetRepository(repoid='rhui-2')
|
||||
]
|
||||
)
|
||||
])
|
||||
@@ -1130,6 +1136,7 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
assert target_repoids == set(['rhui-1', 'rhui-2'])
|
||||
|
||||
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
# If the repos that Leapp identifies as required for the upgrade (based on the repo mapping and PES data) are not
|
||||
# available, an exception shall be raised
|
||||
diff --git a/repos/system_upgrade/common/models/targetrepositories.py b/repos/system_upgrade/common/models/targetrepositories.py
|
||||
index 02c6c5e5..e1a0b646 100644
|
||||
--- a/repos/system_upgrade/common/models/targetrepositories.py
|
||||
+++ b/repos/system_upgrade/common/models/targetrepositories.py
|
||||
@@ -1,4 +1,5 @@
|
||||
from leapp.models import fields, Model
|
||||
+from leapp.reporting import deprecated
|
||||
from leapp.topics import TransactionTopic
|
||||
|
||||
|
||||
@@ -11,10 +12,18 @@ class UsedTargetRepository(TargetRepositoryBase):
|
||||
pass
|
||||
|
||||
|
||||
+@deprecated(
|
||||
+ since="2025-07-23",
|
||||
+ message="This model is deprecated, use DistroTargetRepository instead.",
|
||||
+)
|
||||
class RHELTargetRepository(TargetRepositoryBase):
|
||||
pass
|
||||
|
||||
|
||||
+class DistroTargetRepository(TargetRepositoryBase):
|
||||
+ pass
|
||||
+
|
||||
+
|
||||
class CustomTargetRepository(TargetRepositoryBase):
|
||||
name = fields.Nullable(fields.String())
|
||||
baseurl = fields.Nullable(fields.String())
|
||||
@@ -26,20 +35,39 @@ class TargetRepositories(Model):
|
||||
Repositories supposed to be used during the IPU process
|
||||
|
||||
The list of the actually used repositories could be just subset
|
||||
- of these repositoies. In case of `custom_repositories`, all such repositories
|
||||
+ of these repositories. In case of `custom_repositories`, all such repositories
|
||||
must be available otherwise the upgrade is inhibited. But in case of
|
||||
- `rhel_repos`, only BaseOS and Appstream repos are required now. If others
|
||||
+ `distro_repos`, only BaseOS and Appstream repos are required now. If others
|
||||
are missing, upgrade can still continue.
|
||||
+
|
||||
+ Note: `rhel_repos` are deprecated, use `distro_repos` instead.
|
||||
"""
|
||||
topic = TransactionTopic
|
||||
+
|
||||
+ # DEPRECATED: this has been superseded by distro_repos
|
||||
rhel_repos = fields.List(fields.Model(RHELTargetRepository))
|
||||
"""
|
||||
Expected target YUM RHEL repositories provided via RHSM
|
||||
|
||||
+ DEPRECATED - use distro_repos instead.
|
||||
+
|
||||
These repositories are stored inside /etc/yum.repos.d/redhat.repo and
|
||||
are expected to be used based on the provided repositories mapping.
|
||||
"""
|
||||
|
||||
+ distro_repos = fields.List(fields.Model(DistroTargetRepository))
|
||||
+ """
|
||||
+ Expected target DNF repositories provided by the distribution.
|
||||
+
|
||||
+ On RHEL these are the repositories provided via RHSM.
|
||||
+ These repositories are stored inside /etc/yum.repos.d/redhat.repo and
|
||||
+ are expected to be used based on the provided repositories mapping.
|
||||
+
|
||||
+ On other distributions, such as Centos Stream these are repositories
|
||||
+ in /etc/yum.repos.d/ that are provided by the distribution and are expected
|
||||
+ to be used based on the provided repositories mapping.
|
||||
+ """
|
||||
+
|
||||
custom_repos = fields.List(fields.Model(CustomTargetRepository), default=[])
|
||||
"""
|
||||
Custom YUM repositories required to be used for the IPU
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,65 +0,0 @@
|
||||
From e61718d44e0175bcd28c8a5ee44dc46880d74482 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Tue, 5 Aug 2025 12:20:23 +0200
|
||||
Subject: [PATCH 16/55] checktargetrepos: Skip if not RHEL
|
||||
|
||||
Skip the target repos check on non-RHEL distros. On non-RHEL distros,
|
||||
there is no subscription-manager. The base repositories (BaseOS,
|
||||
AppStream, ...) should always be present.
|
||||
This is checked using the seatbelts in target userspace creator.
|
||||
---
|
||||
.../system_upgrade/common/actors/checktargetrepos/actor.py | 4 +++-
|
||||
.../actors/checktargetrepos/libraries/checktargetrepos.py | 7 ++++---
|
||||
.../actors/checktargetrepos/tests/test_checktargetrepos.py | 2 --
|
||||
3 files changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/actor.py b/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
index d61fb685..a5bdde10 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
@@ -6,7 +6,9 @@ from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
class Checktargetrepos(Actor):
|
||||
"""
|
||||
- Check whether target yum repositories are specified.
|
||||
+ Check whether target dnf repositories are specified on RHEL.
|
||||
+
|
||||
+ NOTE: this actor does nothing on distros other than RHEL.
|
||||
|
||||
RHSM | RHUI | ER | CTR | CTRF || result
|
||||
-----+------+----+-----+------++-------
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
index 141cf8e4..ea21e1de 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
@@ -40,9 +40,10 @@ def process():
|
||||
|
||||
rhui_info = next(api.consume(RHUIInfo), None)
|
||||
|
||||
- if not rhsm.skip_rhsm() or rhui_info:
|
||||
- # getting RH repositories through RHSM or RHUI; resolved by seatbelts
|
||||
- # implemented in other actors
|
||||
+ if config.get_distro_id() != 'rhel' or (not rhsm.skip_rhsm() or rhui_info):
|
||||
+ # RHEL: getting RH repositories through RHSM or RHUI;
|
||||
+ # resolved by seatbelts in other actors
|
||||
+ # other: distro repos provided by the distro directly, seatbelts elsewhere
|
||||
return
|
||||
|
||||
# rhsm skipped; take your seatbelts please
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
index ea93ce7e..e055b3a6 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
@@ -65,9 +65,7 @@ _CUSTOM_TARGET_REPOFILE = CustomTargetRepositoryFile(file='/etc/leapp/files/leap
|
||||
def test_checktargetrepos_rhsm(monkeypatch):
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: False)
|
||||
- monkeypatch.setattr(api, 'consume', MockedConsume())
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
- monkeypatch.setattr(checktargetrepos, 'get_target_major_version', lambda: '8')
|
||||
checktargetrepos.process()
|
||||
assert reporting.create_report.called == 0
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,820 +0,0 @@
|
||||
From 32d9c40ffc7ea8d08e2b85881579ede1fdaedb32 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 7 Aug 2025 13:40:33 +0200
|
||||
Subject: [PATCH 17/55] userspacegen: Add repo gathering for non-RHEL distros
|
||||
|
||||
The _get_rh_available_repoids() function is replaced by the
|
||||
new get_distro_repoids() function from the distro library. This function
|
||||
works with all the "supported" distros.
|
||||
The idea is the same as for RHEL, scan well-known distro-provided
|
||||
repofiles for repositories.
|
||||
For RHEL, at least for now, the existing
|
||||
rhsm.get_rhsm_available_repoids() function is still used.
|
||||
|
||||
These changes together enable the use of repomapping on distros other
|
||||
than RHEL, as before this change the --enablerepo option had to be used
|
||||
to specify target repos and they were treated as custom repos.
|
||||
|
||||
Also, the unused _get_rhui_available_repoids() function is removed.
|
||||
|
||||
Jira: RHEL-107212
|
||||
|
||||
Move get_distro_repoids() to the distro library
|
||||
---
|
||||
.../libraries/userspacegen.py | 228 ++++++++++--------
|
||||
.../tests/unit_test_targetuserspacecreator.py | 56 ++++-
|
||||
.../system_upgrade/common/libraries/distro.py | 192 +++++++++++++++
|
||||
.../common/libraries/tests/test_distro.py | 154 ++++++++++++
|
||||
4 files changed, 524 insertions(+), 106 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 407cb0b7..26fec2d9 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -6,7 +6,7 @@ import shutil
|
||||
from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecution, StopActorExecutionError
|
||||
from leapp.libraries.actor import constants
|
||||
-from leapp.libraries.common import dnfplugin, mounting, overlaygen, repofileutils, rhsm, utils
|
||||
+from leapp.libraries.common import distro, dnfplugin, mounting, overlaygen, repofileutils, rhsm, utils
|
||||
from leapp.libraries.common.config import get_distro_id, get_env, get_product_type
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.common.gpg import get_path_to_gpg_certs, is_nogpgcheck_set
|
||||
@@ -58,6 +58,7 @@ from leapp.utils.deprecation import suppress_deprecation
|
||||
PROD_CERTS_FOLDER = 'prod-certs'
|
||||
PERSISTENT_PACKAGE_CACHE_DIR = '/var/lib/leapp/persistent_package_cache'
|
||||
DEDICATED_LEAPP_PART_URL = 'https://access.redhat.com/solutions/7011704'
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
|
||||
|
||||
def _check_deprecated_rhsm_skip():
|
||||
@@ -778,7 +779,7 @@ def _inhibit_on_duplicate_repos(repofiles):
|
||||
list_separator_fmt = '\n - '
|
||||
api.current_logger().warning(
|
||||
'The following repoids are defined multiple times:{0}{1}'
|
||||
- .format(list_separator_fmt, list_separator_fmt.join(duplicates))
|
||||
+ .format(list_separator_fmt, list_separator_fmt.join(sorted(duplicates)))
|
||||
)
|
||||
|
||||
reporting.create_report([
|
||||
@@ -786,7 +787,7 @@ def _inhibit_on_duplicate_repos(repofiles):
|
||||
reporting.Summary(
|
||||
'The following repositories are defined multiple times inside the'
|
||||
' "upgrade" container:{0}{1}'
|
||||
- .format(list_separator_fmt, list_separator_fmt.join(duplicates))
|
||||
+ .format(list_separator_fmt, list_separator_fmt.join(sorted(duplicates)))
|
||||
),
|
||||
reporting.Severity(reporting.Severity.MEDIUM),
|
||||
reporting.Groups([reporting.Groups.REPOSITORY]),
|
||||
@@ -815,21 +816,19 @@ def _get_all_available_repoids(context):
|
||||
return set(repoids)
|
||||
|
||||
|
||||
-def _get_rhsm_available_repoids(context):
|
||||
- target_major_version = get_target_major_version()
|
||||
+def _inhibit_if_no_base_repos(distro_repoids):
|
||||
# FIXME: check that required repo IDs (baseos, appstream)
|
||||
# + or check that all required RHEL repo IDs are available.
|
||||
- if rhsm.skip_rhsm():
|
||||
- return set()
|
||||
- # Get the RHSM repos available in the target RHEL container
|
||||
- # TODO: very similar thing should happens for all other repofiles in container
|
||||
- #
|
||||
- repoids = rhsm.get_available_repo_ids(context)
|
||||
+
|
||||
+ target_major_version = get_target_major_version()
|
||||
# NOTE(ivasilev) For the moment at least AppStream and BaseOS repos are required. While we are still
|
||||
# contemplating on what can be a generic solution to checking this, let's introduce a minimal check for
|
||||
# at-least-one-appstream and at-least-one-baseos among present repoids
|
||||
- if not repoids or all("baseos" not in ri for ri in repoids) or all("appstream" not in ri for ri in repoids):
|
||||
+ no_baseos = all("baseos" not in ri for ri in distro_repoids)
|
||||
+ no_appstream = all("appstream" not in ri for ri in distro_repoids)
|
||||
+ if no_baseos or no_appstream:
|
||||
reporting.create_report([
|
||||
+ # TODO: Make the report distro agnostic
|
||||
reporting.Title('Cannot find required basic RHEL target repositories.'),
|
||||
reporting.Summary(
|
||||
'This can happen when a repository ID was entered incorrectly either while using the --enablerepo'
|
||||
@@ -861,21 +860,6 @@ def _get_rhsm_available_repoids(context):
|
||||
title='Preparing for the upgrade')
|
||||
])
|
||||
raise StopActorExecution()
|
||||
- return set(repoids)
|
||||
-
|
||||
-
|
||||
-def _get_rhui_available_repoids(context, cloud_repo):
|
||||
- repofiles = repofileutils.get_parsed_repofiles(context)
|
||||
-
|
||||
- # TODO: same refactoring as Issue #486?
|
||||
- _inhibit_on_duplicate_repos(repofiles)
|
||||
- repoids = []
|
||||
- for rfile in repofiles:
|
||||
- if rfile.file == cloud_repo and rfile.data:
|
||||
- repoids = [repo.repoid for repo in rfile.data]
|
||||
- repoids.sort()
|
||||
- break
|
||||
- return set(repoids)
|
||||
|
||||
|
||||
def get_copy_location_from_copy_in_task(context_basepath, copy_task):
|
||||
@@ -886,86 +870,106 @@ def get_copy_location_from_copy_in_task(context_basepath, copy_task):
|
||||
return copy_task.dst
|
||||
|
||||
|
||||
-def _get_rh_available_repoids(context, indata):
|
||||
+def _get_rhui_available_repoids(context, rhui_info):
|
||||
"""
|
||||
- RH repositories are provided either by RHSM or are stored in the expected repo file provided by
|
||||
- RHUI special packages (every cloud provider has itw own rpm).
|
||||
+ Get repoids provided by the RHUI target clients
|
||||
+
|
||||
+ :rtype: set[str]
|
||||
"""
|
||||
+ # If we are upgrading a RHUI system, check what repositories are provided by the (already installed) target clients
|
||||
+ setup_info = rhui_info.target_client_setup_info
|
||||
+ target_content_access_files = set()
|
||||
+ if setup_info.bootstrap_target_client:
|
||||
+ target_content_access_files = _query_rpm_for_pkg_files(context, rhui_info.target_client_pkg_names)
|
||||
|
||||
- rh_repoids = _get_rhsm_available_repoids(context)
|
||||
+ def is_repofile(path):
|
||||
+ return os.path.dirname(path) == '/etc/yum.repos.d' and os.path.basename(path).endswith('.repo')
|
||||
|
||||
- # If we are upgrading a RHUI system, check what repositories are provided by the (already installed) target clients
|
||||
- if indata and indata.rhui_info:
|
||||
- setup_info = indata.rhui_info.target_client_setup_info
|
||||
- target_content_access_files = set()
|
||||
- if setup_info.bootstrap_target_client:
|
||||
- target_content_access_files = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
+ def extract_repoid_from_line(line):
|
||||
+ return line.split(':', 1)[1].strip()
|
||||
|
||||
- def is_repofile(path):
|
||||
- return os.path.dirname(path) == '/etc/yum.repos.d' and os.path.basename(path).endswith('.repo')
|
||||
+ target_ver = api.current_actor().configuration.version.target
|
||||
+ setup_tasks = rhui_info.target_client_setup_info.preinstall_tasks.files_to_copy_into_overlay
|
||||
|
||||
- def extract_repoid_from_line(line):
|
||||
- return line.split(':', 1)[1].strip()
|
||||
+ yum_repos_d = context.full_path('/etc/yum.repos.d')
|
||||
+ all_repofiles = {os.path.join(yum_repos_d, path) for path in os.listdir(yum_repos_d) if path.endswith('.repo')}
|
||||
+ api.current_logger().debug('(RHUI Setup) All available repofiles: {0}'.format(' '.join(all_repofiles)))
|
||||
|
||||
- target_ver = api.current_actor().configuration.version.target
|
||||
- setup_tasks = indata.rhui_info.target_client_setup_info.preinstall_tasks.files_to_copy_into_overlay
|
||||
+ target_access_repofiles = {
|
||||
+ context.full_path(path) for path in target_content_access_files if is_repofile(path)
|
||||
+ }
|
||||
|
||||
- yum_repos_d = context.full_path('/etc/yum.repos.d')
|
||||
- all_repofiles = {os.path.join(yum_repos_d, path) for path in os.listdir(yum_repos_d) if path.endswith('.repo')}
|
||||
- api.current_logger().debug('(RHUI Setup) All available repofiles: {0}'.format(' '.join(all_repofiles)))
|
||||
+ # Exclude repofiles used to setup the target rhui access as on some platforms the repos provided by
|
||||
+ # the client are not sufficient to install the client into target userspace (GCP)
|
||||
+ rhui_setup_repofile_tasks = [task for task in setup_tasks if task.src.endswith('repo')]
|
||||
+ rhui_setup_repofiles = (
|
||||
+ get_copy_location_from_copy_in_task(context.base_dir, copy) for copy in rhui_setup_repofile_tasks
|
||||
+ )
|
||||
+ rhui_setup_repofiles = {context.full_path(repofile) for repofile in rhui_setup_repofiles}
|
||||
|
||||
- target_access_repofiles = {
|
||||
- context.full_path(path) for path in target_content_access_files if is_repofile(path)
|
||||
- }
|
||||
+ foreign_repofiles = all_repofiles - target_access_repofiles - rhui_setup_repofiles
|
||||
|
||||
- # Exclude repofiles used to setup the target rhui access as on some platforms the repos provided by
|
||||
- # the client are not sufficient to install the client into target userspace (GCP)
|
||||
- rhui_setup_repofile_tasks = [task for task in setup_tasks if task.src.endswith('repo')]
|
||||
- rhui_setup_repofiles = (
|
||||
- get_copy_location_from_copy_in_task(context.base_dir, copy) for copy in rhui_setup_repofile_tasks
|
||||
- )
|
||||
- rhui_setup_repofiles = {context.full_path(repofile) for repofile in rhui_setup_repofiles}
|
||||
+ api.current_logger().debug(
|
||||
+ 'The following repofiles are considered as unknown to'
|
||||
+ ' the target RHUI content setup and will be ignored: {0}'.format(' '.join(foreign_repofiles))
|
||||
+ )
|
||||
|
||||
- foreign_repofiles = all_repofiles - target_access_repofiles - rhui_setup_repofiles
|
||||
+ # Rename non-client repofiles so they will not be recognized when running dnf repolist
|
||||
+ for foreign_repofile in foreign_repofiles:
|
||||
+ os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile))
|
||||
|
||||
- api.current_logger().debug(
|
||||
- 'The following repofiles are considered as unknown to'
|
||||
- ' the target RHUI content setup and will be ignored: {0}'.format(' '.join(foreign_repofiles))
|
||||
+ rhui_repoids = set()
|
||||
+ try:
|
||||
+ dnf_cmd = [
|
||||
+ 'dnf', 'repolist',
|
||||
+ '--releasever', target_ver, '-v',
|
||||
+ '--enablerepo', '*',
|
||||
+ '--disablerepo', '*-source-*',
|
||||
+ '--disablerepo', '*-debug-*',
|
||||
+ ]
|
||||
+ repolist_result = context.call(dnf_cmd)['stdout']
|
||||
+ repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')]
|
||||
+ rhui_repoids.update({extract_repoid_from_line(line) for line in repoid_lines})
|
||||
+
|
||||
+ except CalledProcessError as err:
|
||||
+ details = {'err': err.stderr, 'details': str(err)}
|
||||
+ raise StopActorExecutionError(
|
||||
+ message='Failed to retrieve repoids provided by target RHUI clients.',
|
||||
+ details=details
|
||||
)
|
||||
|
||||
- # Rename non-client repofiles so they will not be recognized when running dnf repolist
|
||||
+ finally:
|
||||
+ # Revert the renaming of non-client repofiles
|
||||
for foreign_repofile in foreign_repofiles:
|
||||
- os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile))
|
||||
+ os.rename('{0}.back'.format(foreign_repofile), foreign_repofile)
|
||||
|
||||
- try:
|
||||
- dnf_cmd = [
|
||||
- 'dnf', 'repolist',
|
||||
- '--releasever', target_ver, '-v',
|
||||
- '--enablerepo', '*',
|
||||
- '--disablerepo', '*-source-*',
|
||||
- '--disablerepo', '*-debug-*',
|
||||
- ]
|
||||
- repolist_result = context.call(dnf_cmd)['stdout']
|
||||
- repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')]
|
||||
- rhui_repoids = {extract_repoid_from_line(line) for line in repoid_lines}
|
||||
- rh_repoids.update(rhui_repoids)
|
||||
-
|
||||
- except CalledProcessError as err:
|
||||
- details = {'err': err.stderr, 'details': str(err)}
|
||||
- raise StopActorExecutionError(
|
||||
- message='Failed to retrieve repoids provided by target RHUI clients.',
|
||||
- details=details
|
||||
- )
|
||||
+ return rhui_repoids
|
||||
|
||||
- finally:
|
||||
- # Revert the renaming of non-client repofiles
|
||||
- for foreign_repofile in foreign_repofiles:
|
||||
- os.rename('{0}.back'.format(foreign_repofile), foreign_repofile)
|
||||
|
||||
- api.current_logger().debug(
|
||||
- 'The following repofiles are considered as provided by RedHat: {0}'.format(' '.join(rh_repoids))
|
||||
- )
|
||||
- return rh_repoids
|
||||
+def _get_distro_available_repoids(context, indata):
|
||||
+ """
|
||||
+ Get repoids provided by the distribution
|
||||
+
|
||||
+ On RHEL: RH repositories are provided either by RHSM or are stored in the
|
||||
+ expected repo file provided by RHUI special packages (every cloud
|
||||
+ provider has itw own rpm).
|
||||
+ On other: Repositories are provided in specific repofiles (e.g. centos.repo
|
||||
+ and centos-addons.repo on CS)
|
||||
+
|
||||
+ :return: A set of repoids provided by distribution
|
||||
+ :rtype: set[str]
|
||||
+ """
|
||||
+ distro_repoids = distro.get_target_distro_repoids(context)
|
||||
+ distro_id = get_distro_id()
|
||||
+ rhel_and_rhsm = distro_id == 'rhel' and not rhsm.skip_rhsm()
|
||||
+ if distro_id != 'rhel' or rhel_and_rhsm:
|
||||
+ _inhibit_if_no_base_repos(distro_repoids)
|
||||
+
|
||||
+ if indata and indata.rhui_info:
|
||||
+ rhui_repoids = _get_rhui_available_repoids(context, indata.rhui_info)
|
||||
+ distro_repoids.extend(rhui_repoids)
|
||||
+
|
||||
+ return set(distro_repoids)
|
||||
|
||||
|
||||
@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
@@ -986,17 +990,31 @@ def gather_target_repositories(context, indata):
|
||||
:param context: An instance of a mounting.IsolatedActions class
|
||||
:type context: mounting.IsolatedActions class
|
||||
:return: List of target system repoids
|
||||
- :rtype: List(string)
|
||||
+ :rtype: set[str]
|
||||
"""
|
||||
- rh_available_repoids = _get_rh_available_repoids(context, indata)
|
||||
- all_available_repoids = _get_all_available_repoids(context)
|
||||
|
||||
- target_repoids = []
|
||||
- missing_custom_repoids = []
|
||||
+ distro_repoids = _get_distro_available_repoids(context, indata)
|
||||
+ if distro_repoids:
|
||||
+ api.current_logger().info(
|
||||
+ "The following repoids are considered as provided by the '{}' distribution:{}{}".format(
|
||||
+ get_distro_id(),
|
||||
+ FMT_LIST_SEPARATOR,
|
||||
+ FMT_LIST_SEPARATOR.join(sorted(distro_repoids)),
|
||||
+ )
|
||||
+ )
|
||||
+ else:
|
||||
+ api.current_logger().warning(
|
||||
+ "No repoids provided by the {} distribution have been discovered".format(get_distro_id())
|
||||
+ )
|
||||
+
|
||||
+ all_repoids = _get_all_available_repoids(context)
|
||||
+
|
||||
+ target_repoids = set()
|
||||
+ missing_custom_repoids = set()
|
||||
for target_repo in api.consume(TargetRepositories):
|
||||
- for rhel_repo in target_repo.rhel_repos:
|
||||
- if rhel_repo.repoid in rh_available_repoids:
|
||||
- target_repoids.append(rhel_repo.repoid)
|
||||
+ for distro_repo in target_repo.distro_repos:
|
||||
+ if distro_repo.repoid in distro_repoids:
|
||||
+ target_repoids.add(distro_repo.repoid)
|
||||
else:
|
||||
# TODO: We shall report that the RHEL repos that we deem necessary for
|
||||
# the upgrade are not available; but currently it would just print bunch of
|
||||
@@ -1005,12 +1023,16 @@ def gather_target_repositories(context, indata):
|
||||
# of the upgrade. Let's skip it for now until it's clear how we will deal
|
||||
# with it.
|
||||
pass
|
||||
+
|
||||
for custom_repo in target_repo.custom_repos:
|
||||
- if custom_repo.repoid in all_available_repoids:
|
||||
- target_repoids.append(custom_repo.repoid)
|
||||
+ if custom_repo.repoid in all_repoids:
|
||||
+ target_repoids.add(custom_repo.repoid)
|
||||
else:
|
||||
- missing_custom_repoids.append(custom_repo.repoid)
|
||||
- api.current_logger().debug("Gathered target repositories: {}".format(', '.join(target_repoids)))
|
||||
+ missing_custom_repoids.add(custom_repo.repoid)
|
||||
+ api.current_logger().debug(
|
||||
+ "Gathered target repositories: {}".format(", ".join(sorted(target_repoids)))
|
||||
+ )
|
||||
+
|
||||
if not target_repoids:
|
||||
target_major_version = get_target_major_version()
|
||||
reporting.create_report([
|
||||
@@ -1056,7 +1078,7 @@ def gather_target_repositories(context, indata):
|
||||
' while using the --enablerepo option of leapp, or in a third party actor that produces a'
|
||||
' CustomTargetRepositoryMessage.\n'
|
||||
'The following repositories IDs could not be found in the target configuration:\n'
|
||||
- '- {}\n'.format('\n- '.join(missing_custom_repoids))
|
||||
+ '- {}\n'.format('\n- '.join(sorted(missing_custom_repoids)))
|
||||
),
|
||||
reporting.Groups([reporting.Groups.REPOSITORY]),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
@@ -1073,7 +1095,7 @@ def gather_target_repositories(context, indata):
|
||||
))
|
||||
])
|
||||
raise StopActorExecution()
|
||||
- return set(target_repoids)
|
||||
+ return target_repoids
|
||||
|
||||
|
||||
def _install_custom_repofiles(context, custom_repofiles):
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index f05e6bc2..2ae194d7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -11,9 +11,9 @@ import pytest
|
||||
from leapp import models, reporting
|
||||
from leapp.exceptions import StopActorExecution, StopActorExecutionError
|
||||
from leapp.libraries.actor import userspacegen
|
||||
-from leapp.libraries.common import overlaygen, repofileutils, rhsm
|
||||
+from leapp.libraries.common import distro, overlaygen, repofileutils, rhsm
|
||||
from leapp.libraries.common.config import architecture
|
||||
-from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked, logger_mocked, produce_mocked
|
||||
from leapp.libraries.stdlib import api, CalledProcessError
|
||||
from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
@@ -1115,7 +1115,9 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
monkeypatch.setattr(userspacegen.api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(userspacegen, '_get_all_available_repoids', lambda x: [])
|
||||
monkeypatch.setattr(
|
||||
- userspacegen, '_get_rh_available_repoids', lambda x, y: ['rhui-1', 'rhui-2', 'rhui-3']
|
||||
+ userspacegen,
|
||||
+ "_get_distro_available_repoids",
|
||||
+ lambda dummy_context, dummy_indata: {"rhui-1", "rhui-2", "rhui-3"},
|
||||
)
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
monkeypatch.setattr(
|
||||
@@ -1195,6 +1197,54 @@ def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
|
||||
|
||||
+def test__get_distro_available_repoids_norhsm_norhui(monkeypatch):
|
||||
+ """
|
||||
+ Empty set should be returned when on rhel and skip_rhsm == True.
|
||||
+ """
|
||||
+ monkeypatch.setattr(
|
||||
+ userspacegen.api, "current_actor", CurrentActorMocked(release_id="rhel")
|
||||
+ )
|
||||
+ monkeypatch.setattr(userspacegen.api.current_actor(), 'produce', produce_mocked())
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_repoids', lambda ctx: [])
|
||||
+
|
||||
+ indata = testInData(_PACKAGES_MSGS, None, None, _XFS_MSG, _STORAGEINFO_MSG, None)
|
||||
+ # NOTE: context is not used without rhsm, for simplicity setting to None
|
||||
+ repoids = userspacegen._get_distro_available_repoids(None, indata)
|
||||
+ assert repoids == set()
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ "distro_id,skip_rhsm", [("rhel", False), ("centos", True), ("almalinux", True)]
|
||||
+)
|
||||
+def test__get_distro_available_repoids_nobaserepos_inhibit(
|
||||
+ monkeypatch, distro_id, skip_rhsm
|
||||
+):
|
||||
+ """
|
||||
+ Test that get_distro_available repoids reports and raises if there are no base repos.
|
||||
+ """
|
||||
+ monkeypatch.setattr(
|
||||
+ userspacegen.api, "current_actor", CurrentActorMocked(release_id=distro_id)
|
||||
+ )
|
||||
+ monkeypatch.setattr(userspacegen.api.current_actor(), 'produce', produce_mocked())
|
||||
+ monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_repoids', lambda ctx: [])
|
||||
+
|
||||
+ indata = testInData(_PACKAGES_MSGS, None, None, _XFS_MSG, _STORAGEINFO_MSG, None)
|
||||
+ with pytest.raises(StopActorExecution):
|
||||
+ # NOTE: context is not used without rhsm, for simplicity setting to None
|
||||
+ userspacegen._get_distro_available_repoids(None, indata)
|
||||
+
|
||||
+ # TODO adjust the asserts when the report is made distro agnostic
|
||||
+ assert reporting.create_report.called == 1
|
||||
+ report = reporting.create_report.reports[0]
|
||||
+ assert "Cannot find required basic RHEL target repositories" in report["title"]
|
||||
+ assert reporting.Groups.INHIBITOR in report["groups"]
|
||||
+
|
||||
+
|
||||
def mocked_consume_data():
|
||||
packages = {'dnf', 'dnf-command(config-manager)', 'pkgA', 'pkgB'}
|
||||
rhsm_info = _RHSMINFO_MSG
|
||||
diff --git a/repos/system_upgrade/common/libraries/distro.py b/repos/system_upgrade/common/libraries/distro.py
|
||||
index 2ed5eacd..d6a2381a 100644
|
||||
--- a/repos/system_upgrade/common/libraries/distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/distro.py
|
||||
@@ -2,6 +2,10 @@ import json
|
||||
import os
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.common import repofileutils, rhsm
|
||||
+from leapp.libraries.common.config import get_distro_id
|
||||
+from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_X86_64
|
||||
+from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
|
||||
|
||||
@@ -16,3 +20,191 @@ def get_distribution_data(distribution):
|
||||
raise StopActorExecutionError(
|
||||
'Cannot find distribution signature configuration.',
|
||||
details={'Problem': 'Distribution {} was not found in {}.'.format(distribution, distributions_path)})
|
||||
+
|
||||
+
|
||||
+# distro -> major_version -> repofile -> tuple of architectures where it's present
|
||||
+_DISTRO_REPOFILES_MAP = {
|
||||
+ 'rhel': {
|
||||
+ '8': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ '9': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ '10': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ },
|
||||
+ 'centos': {
|
||||
+ '8': {
|
||||
+ # TODO is this true on all archs?
|
||||
+ 'CentOS-Linux-AppStream.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-BaseOS.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-ContinuousRelease.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Debuginfo.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Devel.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Extras.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-FastTrack.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-HighAvailability.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Media.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Plus.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-PowerTools.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Sources.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '9': {
|
||||
+ '/etc/yum.repos.d/centos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/centos-addons.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '10': {
|
||||
+ '/etc/yum.repos.d/centos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/centos-addons.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ },
|
||||
+ 'almalinux': {
|
||||
+ '8': {
|
||||
+ # TODO is this true on all archs?
|
||||
+ '/etc/yum.repos.d/almalinux-ha.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-powertools.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-resilientstorage.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '9': {
|
||||
+ '/etc/yum.repos.d/almalinux-appstream.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-baseos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-crb.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-extras.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-highavailability.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-resilientstorage.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ # RT and NFV are only on x86_64 on almalinux 9
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': (ARCH_X86_64,),
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': (ARCH_X86_64,),
|
||||
+ },
|
||||
+ '10': {
|
||||
+ # no resilientstorage on 10
|
||||
+ '/etc/yum.repos.d/almalinux-appstream.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-baseos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-crb.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-extras.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-highavailability.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ # RT and NFV are only on x86_64 on almalinux 10
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': (ARCH_X86_64,),
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': (ARCH_X86_64,),
|
||||
+ },
|
||||
+ },
|
||||
+}
|
||||
+
|
||||
+
|
||||
+def _get_distro_repofiles(distro, major_version, arch):
|
||||
+ """
|
||||
+ Get distribution provided repofiles.
|
||||
+
|
||||
+ Note that this does not perform any validation, the caller must check
|
||||
+ whether the files exist.
|
||||
+
|
||||
+ :param distro: The distribution to get repofiles for.
|
||||
+ :type distro: str
|
||||
+ :param major_version: The major version to get repofiles for.
|
||||
+ :type major_version: str
|
||||
+ :param arch: The architecture to get repofiles for.
|
||||
+ :type arch: str
|
||||
+ :return: A list of paths to repofiles provided by distribution
|
||||
+ :rtype: list[str] or None if no repofiles are mapped for the arguments
|
||||
+ """
|
||||
+
|
||||
+ distro_repofiles = _DISTRO_REPOFILES_MAP.get(distro)
|
||||
+ if not distro_repofiles:
|
||||
+ return None
|
||||
+
|
||||
+ version_repofiles = distro_repofiles.get(major_version, {})
|
||||
+ if not version_repofiles:
|
||||
+ return None
|
||||
+
|
||||
+ return [repofile for repofile, archs in version_repofiles.items() if arch in archs]
|
||||
+
|
||||
+
|
||||
+def get_target_distro_repoids(context):
|
||||
+ """
|
||||
+ Get repoids defined in distro provided repofiles
|
||||
+
|
||||
+ See the generic :func:`_get_distro_repoids` for more details.
|
||||
+
|
||||
+ :param context: An instance of mounting.IsolatedActions class
|
||||
+ :type context: mounting.IsolatedActions
|
||||
+ :return: Repoids of distribution provided repositories
|
||||
+ :type: list[str]
|
||||
+ """
|
||||
+
|
||||
+ return get_distro_repoids(
|
||||
+ context,
|
||||
+ get_distro_id(),
|
||||
+ get_target_major_version(),
|
||||
+ api.current_actor().configuration.architecture
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def get_distro_repoids(context, distro, major_version, arch):
|
||||
+ """
|
||||
+ Get repoids defined in distro provided repofiles
|
||||
+
|
||||
+ On RHEL with RHSM this delegates to rhsm.get_available_repo_ids.
|
||||
+
|
||||
+ Repofiles installed by RHUI client packages are not covered by this
|
||||
+ function.
|
||||
+
|
||||
+ :param context: An instance of mounting.IsolatedActions class
|
||||
+ :type context: mounting.IsolatedActions
|
||||
+ :param distro: The distro whose repoids to return
|
||||
+ :type distro: str
|
||||
+ :param major_version: The major version to get distro repoids for.
|
||||
+ :type major_version: str
|
||||
+ :param arch: The architecture to get distro repoids for.
|
||||
+ :type arch: str
|
||||
+ :return: Repoids of distribution provided repositories
|
||||
+ :type: list[str]
|
||||
+ """
|
||||
+
|
||||
+ if distro == 'rhel':
|
||||
+ if rhsm.skip_rhsm():
|
||||
+ return []
|
||||
+ # Kept this todo here from the original code from
|
||||
+ # userspacegen._get_rh_available_repoids:
|
||||
+ # Get the RHSM repos available in the target RHEL container
|
||||
+ # TODO: very similar thing should happens for all other repofiles in container
|
||||
+ return rhsm.get_available_repo_ids(context)
|
||||
+
|
||||
+ repofiles = repofileutils.get_parsed_repofiles(context)
|
||||
+ distro_repofiles = _get_distro_repofiles(distro, major_version, arch)
|
||||
+ if not distro_repofiles:
|
||||
+ # TODO: a different way of signaling an error would be preferred (e.g. returning None),
|
||||
+ # but since rhsm.get_available_repo_ids also raises StopActorExecutionError,
|
||||
+ # let's make it easier for the caller for now and use it too
|
||||
+ raise StopActorExecutionError(
|
||||
+ "No known distro provided repofiles mapped",
|
||||
+ details={
|
||||
+ "details": "distro: {}, major version: {}, architecture: {}".format(
|
||||
+ distro, major_version, arch
|
||||
+ )
|
||||
+ },
|
||||
+ )
|
||||
+
|
||||
+ distro_repoids = []
|
||||
+ for rfile in repofiles:
|
||||
+ if rfile.file in distro_repofiles:
|
||||
+
|
||||
+ if not os.path.exists(context.full_path(rfile.file)):
|
||||
+ api.current_logger().debug(
|
||||
+ "Expected distribution provided repofile does not exists: {}".format(
|
||||
+ rfile
|
||||
+ )
|
||||
+ )
|
||||
+ continue
|
||||
+
|
||||
+ if rfile.data:
|
||||
+ distro_repoids.extend([repo.repoid for repo in rfile.data])
|
||||
+
|
||||
+ return sorted(distro_repoids)
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
new file mode 100644
|
||||
index 00000000..3a8f174f
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -0,0 +1,154 @@
|
||||
+import os
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.actors import StopActorExecutionError
|
||||
+from leapp.libraries.common import distro, repofileutils, rhsm
|
||||
+from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_ARM64, ARCH_PPC64LE, ARCH_S390X, ARCH_X86_64
|
||||
+from leapp.libraries.common.distro import _get_distro_repofiles, get_distro_repoids
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import RepositoryData, RepositoryFile
|
||||
+
|
||||
+_RHEL_REPOFILES = ['/etc/yum.repos.d/redhat.repo']
|
||||
+_CENTOS_REPOFILES = [
|
||||
+ "/etc/yum.repos.d/centos.repo", "/etc/yum.repos.d/centos-addons.repo"
|
||||
+]
|
||||
+
|
||||
+
|
||||
+def test_get_distro_repofiles(monkeypatch):
|
||||
+ """
|
||||
+ Test the functionality, not the data.
|
||||
+ """
|
||||
+ test_map = {
|
||||
+ 'distro1': {
|
||||
+ '8': {
|
||||
+ 'repofile1': ARCH_ACCEPTED,
|
||||
+ 'repofile2': [ARCH_X86_64],
|
||||
+ },
|
||||
+ '9': {
|
||||
+ 'repofile3': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ },
|
||||
+ 'distro2': {
|
||||
+ '8': {},
|
||||
+ '9': {
|
||||
+ 'repofile2': [ARCH_X86_64],
|
||||
+ 'repofile3': [ARCH_ARM64, ARCH_S390X, ARCH_PPC64LE],
|
||||
+ },
|
||||
+ },
|
||||
+ }
|
||||
+ monkeypatch.setattr(distro, '_DISTRO_REPOFILES_MAP', test_map)
|
||||
+
|
||||
+ # mix of all and specific arch
|
||||
+ repofiles = _get_distro_repofiles('distro1', '8', ARCH_X86_64)
|
||||
+ assert repofiles == ['repofile1', 'repofile2']
|
||||
+
|
||||
+ # match all but not x86_64
|
||||
+ repofiles = _get_distro_repofiles('distro1', '8', ARCH_ARM64)
|
||||
+ assert repofiles == ['repofile1']
|
||||
+
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_X86_64)
|
||||
+ assert repofiles == ['repofile2']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_ARM64)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_S390X)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_PPC64LE)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+
|
||||
+ # version not mapped
|
||||
+ repofiles = _get_distro_repofiles('distro2', '8', ARCH_X86_64)
|
||||
+ assert repofiles is None
|
||||
+
|
||||
+ # distro not mapped
|
||||
+ repofiles = _get_distro_repofiles('distro42', '8', ARCH_X86_64)
|
||||
+ assert repofiles is None
|
||||
+
|
||||
+
|
||||
+def _make_repo(repoid):
|
||||
+ return RepositoryData(repoid=repoid, name='name {}'.format(repoid))
|
||||
+
|
||||
+
|
||||
+def _make_repofile(rfile, data=None):
|
||||
+ if data is None:
|
||||
+ data = [_make_repo("{}-{}".format(rfile.split("/")[-1], i)) for i in range(3)]
|
||||
+ return RepositoryFile(file=rfile, data=data)
|
||||
+
|
||||
+
|
||||
+def _make_repofiles(rfiles):
|
||||
+ return [_make_repofile(rfile) for rfile in rfiles]
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('other_rfiles', [
|
||||
+ [],
|
||||
+ [_make_repofile("foo")],
|
||||
+ _make_repofiles(["foo", "bar"]),
|
||||
+])
|
||||
+@pytest.mark.parametrize(
|
||||
+ "distro_id,skip_rhsm,distro_rfiles",
|
||||
+ [
|
||||
+ ("rhel", True, []),
|
||||
+ ("rhel", True, _make_repofiles(_RHEL_REPOFILES)),
|
||||
+ ("rhel", False, _make_repofiles(_RHEL_REPOFILES)),
|
||||
+ ("centos", True, []),
|
||||
+ ("centos", True, _make_repofiles(_CENTOS_REPOFILES)),
|
||||
+ ]
|
||||
+)
|
||||
+def test_get_distro_repoids(
|
||||
+ monkeypatch, distro_id, skip_rhsm, distro_rfiles, other_rfiles
|
||||
+):
|
||||
+ """
|
||||
+ Tests that the correct repoids are returned
|
||||
+
|
||||
+ This is a little ugly because on RHEL the get_distro_repoids function still
|
||||
+ delegates to rhsm.get_available_repo_ids and also has different behavior
|
||||
+ with skip_rhsm
|
||||
+ """
|
||||
+ current_actor = CurrentActorMocked(release_id=distro_id if distro_id else 'rhel')
|
||||
+ monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
+
|
||||
+ repofiles = other_rfiles
|
||||
+ if distro_rfiles:
|
||||
+ repofiles.extend(distro_rfiles)
|
||||
+ monkeypatch.setattr(repofileutils, 'get_parsed_repofiles', lambda x: repofiles)
|
||||
+
|
||||
+ distro_repoids = []
|
||||
+ for rfile in distro_rfiles:
|
||||
+ distro_repoids.extend([repo.repoid for repo in rfile.data] if rfile else [])
|
||||
+ distro_repoids.sort()
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'get_available_repo_ids', lambda _: distro_repoids)
|
||||
+ monkeypatch.setattr(os.path, 'exists', lambda f: f in _CENTOS_REPOFILES)
|
||||
+
|
||||
+ class MockedContext:
|
||||
+ def full_path(self, path):
|
||||
+ return path
|
||||
+
|
||||
+ repoids = get_distro_repoids(MockedContext(), distro_id, '9', 'x86_64')
|
||||
+
|
||||
+ if distro_id == 'rhel' and skip_rhsm:
|
||||
+ assert repoids == []
|
||||
+ else:
|
||||
+ assert sorted(repoids) == distro_repoids
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('other_rfiles', [
|
||||
+ [],
|
||||
+ [_make_repofile("foo")],
|
||||
+ _make_repofiles(["foo", "bar"]),
|
||||
+])
|
||||
+def test_get_distro_repoids_no_distro_repofiles(monkeypatch, other_rfiles):
|
||||
+ """
|
||||
+ Test that exception is thrown when there are no known distro provided repofiles.
|
||||
+ """
|
||||
+
|
||||
+ def mocked_get_distro_repofiles(*args):
|
||||
+ return []
|
||||
+
|
||||
+ monkeypatch.setattr(distro, '_get_distro_repofiles', mocked_get_distro_repofiles)
|
||||
+ monkeypatch.setattr(repofileutils, "get_parsed_repofiles", lambda x: other_rfiles)
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError):
|
||||
+ get_distro_repoids(None, 'somedistro', '8', 'x86_64')
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
From ae9a953dc111c0b14a8b86b3f0aee26cea1f08b4 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 1 Sep 2025 23:43:53 +0200
|
||||
Subject: [PATCH 18/55] lib/distro: Add tests for existing
|
||||
get_distribution_data() function
|
||||
|
||||
---
|
||||
.../common/libraries/tests/test_distro.py | 47 ++++++++++++++++++-
|
||||
1 file changed, 46 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
index 3a8f174f..8e866455 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+import json
|
||||
import os
|
||||
|
||||
import pytest
|
||||
@@ -5,7 +6,7 @@ import pytest
|
||||
from leapp.actors import StopActorExecutionError
|
||||
from leapp.libraries.common import distro, repofileutils, rhsm
|
||||
from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_ARM64, ARCH_PPC64LE, ARCH_S390X, ARCH_X86_64
|
||||
-from leapp.libraries.common.distro import _get_distro_repofiles, get_distro_repoids
|
||||
+from leapp.libraries.common.distro import _get_distro_repofiles, get_distribution_data, get_distro_repoids
|
||||
from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import RepositoryData, RepositoryFile
|
||||
@@ -15,6 +16,50 @@ _CENTOS_REPOFILES = [
|
||||
"/etc/yum.repos.d/centos.repo", "/etc/yum.repos.d/centos-addons.repo"
|
||||
]
|
||||
|
||||
+_CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('distro', ['rhel', 'centos'])
|
||||
+def test_get_distribution_data(monkeypatch, distro):
|
||||
+ common_path = os.path.join(_CUR_DIR, "../../files/", 'distro')
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "get_common_folder_path",
|
||||
+ lambda folder: common_path
|
||||
+ )
|
||||
+ data_path = os.path.join(common_path, distro, "gpg-signatures.json")
|
||||
+
|
||||
+ def exists_mocked(path):
|
||||
+ assert path == data_path
|
||||
+ return True
|
||||
+
|
||||
+ monkeypatch.setattr(os.path, 'exists', exists_mocked)
|
||||
+ ret = get_distribution_data(distro)
|
||||
+
|
||||
+ with open(data_path) as fp:
|
||||
+ assert ret == json.load(fp)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('distro', ['rhel', 'centos'])
|
||||
+def test_get_distribution_data_not_exists(monkeypatch, distro):
|
||||
+ common_path = os.path.join(_CUR_DIR, "../../files/", 'distro')
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "get_common_folder_path",
|
||||
+ lambda folder: common_path
|
||||
+ )
|
||||
+ data_path = os.path.join(common_path, distro, "gpg-signatures.json")
|
||||
+
|
||||
+ def exists_mocked(path):
|
||||
+ assert path == data_path
|
||||
+ return False
|
||||
+
|
||||
+ monkeypatch.setattr(os.path, 'exists', exists_mocked)
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError) as err:
|
||||
+ get_distribution_data(distro)
|
||||
+ assert 'Cannot find distribution signature configuration.' in err
|
||||
+
|
||||
|
||||
def test_get_distro_repofiles(monkeypatch):
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,152 +0,0 @@
|
||||
From e749dbc430099ac0d0cb06fb9dff4ec458d359b3 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Diblik <ddiblik@redhat.com>
|
||||
Date: Fri, 10 Oct 2025 16:51:34 +0200
|
||||
Subject: [PATCH 19/55] Disable RHSM tests
|
||||
|
||||
Signed-off-by: Daniel Diblik <ddiblik@redhat.com>
|
||||
---
|
||||
.packit.yaml | 30 +++++++++++++++---------------
|
||||
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 607dff93..3d1cd7ff 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -155,7 +155,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -209,7 +209,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -232,7 +232,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -258,7 +258,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -284,7 +284,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -306,7 +306,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -332,7 +332,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -358,7 +358,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -434,7 +434,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:9to10 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -463,7 +463,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -489,7 +489,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -514,7 +514,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:9to10 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -543,7 +543,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -572,7 +572,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,462 +0,0 @@
|
||||
From 6a38e8a3373bdc41a04538a090531ba0ccf8fa96 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 14 Oct 2025 15:11:02 +0200
|
||||
Subject: [PATCH 20/55] Update packit config
|
||||
|
||||
Introduce refactor of labels and introduce 8.10 -> 9.6 AWS tests.
|
||||
---
|
||||
.packit.yaml | 285 ++++++++++++++++++++++++++-------------------------
|
||||
1 file changed, 143 insertions(+), 142 deletions(-)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 3d1cd7ff..720d07a7 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -104,6 +104,8 @@ jobs:
|
||||
# is the last RHEL 8 release and all new future tests will start from this
|
||||
# one release.
|
||||
|
||||
+# This job is never triggered - we define abstract anchor that are reused in jobs that 'inherit'
|
||||
+# and have actionable triggers
|
||||
- &sanity-abstract-8to9
|
||||
job: tests
|
||||
trigger: ignore
|
||||
@@ -116,6 +118,47 @@ jobs:
|
||||
epel-8-x86_64:
|
||||
distros: [RHEL-8.10.0-Nightly]
|
||||
identifier: sanity-abstract-8to9
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9'
|
||||
+ environments:
|
||||
+ - &tmt-env-settings-810to94
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to94
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.4"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to96
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to96
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.6"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to97
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to97
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.7"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to98
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to98
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.8"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
- &sanity-abstract-8to9-aws
|
||||
<<: *sanity-abstract-8to9
|
||||
@@ -147,7 +190,10 @@ jobs:
|
||||
# ######################### Individual tests ########################### #
|
||||
# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.4
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.4 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
- &sanity-810to94
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -157,15 +203,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to94
|
||||
+ env: &env-810to94
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.4"
|
||||
LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
@@ -184,18 +223,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to94
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.4"
|
||||
- LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
+ <<: *env-810to94
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to94
|
||||
@@ -212,19 +242,19 @@ jobs:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
+ context: *tmt-context-810to94
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.4"
|
||||
- LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
+ <<: *env-810to94
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.6 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.6
|
||||
- &sanity-810to96
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -234,15 +264,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to96
|
||||
+ env: &env-810to96
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.6"
|
||||
|
||||
@@ -260,17 +283,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to96
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.6"
|
||||
+ <<: *env-810to96
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to96
|
||||
@@ -285,20 +300,37 @@ jobs:
|
||||
test:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to96
|
||||
+ env:
|
||||
+ <<: *env-810to96
|
||||
+
|
||||
+- &sanity-810to96-aws
|
||||
+ <<: *sanity-abstract-8to9-aws
|
||||
+ trigger: pull_request
|
||||
+ targets:
|
||||
+ epel-8-x86_64:
|
||||
+ distros: [RHEL-8.10-rhui]
|
||||
+ identifier: sanity-8.10to9.6-aws
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:rhui-aws-tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
+ context: *tmt-context-810to96
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.6"
|
||||
+ <<: *env-810to96
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.7 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.7
|
||||
- &sanity-810to97
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -308,15 +340,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to97
|
||||
+ env: &env-810to97
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.7"
|
||||
|
||||
@@ -334,17 +359,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to97
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.7"
|
||||
+ <<: *env-810to97
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to97
|
||||
@@ -360,17 +377,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to97
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.7"
|
||||
+ <<: *env-810to97
|
||||
|
||||
# ###################################################################### #
|
||||
# ############################## 9 TO 10 ################################ #
|
||||
@@ -392,6 +401,38 @@ jobs:
|
||||
epel-9-x86_64:
|
||||
distros: [RHEL-9.6.0-Nightly]
|
||||
identifier: sanity-abstract-9to10
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:9to10'
|
||||
+ environments:
|
||||
+ - &tmt-env-settings-96to100
|
||||
+ tmt:
|
||||
+ context: &tmt-context-96to100
|
||||
+ distro: "rhel-9.6"
|
||||
+ distro_target: "rhel-10.0"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-97to101
|
||||
+ tmt:
|
||||
+ context: &tmt-context-97to101
|
||||
+ distro: "rhel-9.7"
|
||||
+ distro_target: "rhel-10.1"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-98to102
|
||||
+ tmt:
|
||||
+ context: &tmt-context-98to102
|
||||
+ distro: "rhel-9.8"
|
||||
+ distro_target: "rhel-10.2"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
- &sanity-abstract-9to10-aws
|
||||
<<: *sanity-abstract-9to10
|
||||
@@ -423,7 +464,10 @@ jobs:
|
||||
# ######################### Individual tests ########################### #
|
||||
# ###################################################################### #
|
||||
|
||||
-# Tests: 9.6 -> 10.0
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.6 > 10.0 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
- &sanity-96to100
|
||||
<<: *sanity-abstract-9to10
|
||||
trigger: pull_request
|
||||
@@ -436,15 +480,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-96to100
|
||||
+ env: &env-96to100
|
||||
SOURCE_RELEASE: "9.6"
|
||||
TARGET_RELEASE: "10.0"
|
||||
|
||||
@@ -465,17 +502,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-96to100
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.6"
|
||||
- TARGET_RELEASE: "10.0"
|
||||
+ <<: *env-96to100
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-96to100
|
||||
@@ -491,19 +520,14 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-96to100
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.6"
|
||||
- TARGET_RELEASE: "10.0"
|
||||
+ <<: *env-96to100
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.7 > 10.1 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 9.7 -> 10.1
|
||||
- &sanity-97to101
|
||||
<<: *sanity-abstract-9to10
|
||||
trigger: pull_request
|
||||
@@ -516,15 +540,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-97to101
|
||||
+ env: &env-97to101
|
||||
SOURCE_RELEASE: "9.7"
|
||||
TARGET_RELEASE: "10.1"
|
||||
|
||||
@@ -545,17 +562,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-97to101
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.7"
|
||||
- TARGET_RELEASE: "10.1"
|
||||
+ <<: *env-97to101
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-97to101
|
||||
@@ -574,14 +583,6 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-97to101
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.7"
|
||||
- TARGET_RELEASE: "10.1"
|
||||
+ <<: *env-97to101
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,880 +0,0 @@
|
||||
From 06afa61c2508f18937244787440c709c5ee0a285 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 14 Oct 2025 15:56:11 +0200
|
||||
Subject: [PATCH 21/55] Update upgrade paths: 8.10 -> 9.8 -> 10.2 with
|
||||
certificates
|
||||
|
||||
Jira: RHEL-108025
|
||||
---
|
||||
.packit.yaml | 119 ++++++++++++++++++
|
||||
.../common/files/prod-certs/10.2/279.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/362.pem | 36 ++++++
|
||||
.../common/files/prod-certs/10.2/363.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/419.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/433.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/479.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/486.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/72.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/279.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/362.pem | 36 ++++++
|
||||
.../common/files/prod-certs/9.8/363.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/419.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/433.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/479.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/486.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/72.pem | 35 ++++++
|
||||
.../common/files/upgrade_paths.json | 10 +-
|
||||
18 files changed, 687 insertions(+), 4 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 720d07a7..0c3f682a 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -381,6 +381,60 @@ jobs:
|
||||
env:
|
||||
<<: *env-810to97
|
||||
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.8 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+- &sanity-810to98
|
||||
+ <<: *sanity-abstract-8to9
|
||||
+ trigger: pull_request
|
||||
+ identifier: sanity-8.10to9.8
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env: &env-810to98
|
||||
+ SOURCE_RELEASE: "8.10"
|
||||
+ TARGET_RELEASE: "9.8"
|
||||
+
|
||||
+# On-demand minimal beaker tests
|
||||
+- &beaker-minimal-810to98
|
||||
+ <<: *beaker-minimal-8to9-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - beaker-minimal
|
||||
+ - beaker-minimal-8.10to9.8
|
||||
+ - 8.10to9.8
|
||||
+ identifier: sanity-8.10to9.8-beaker-minimal-ondemand
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env:
|
||||
+ <<: *env-810to98
|
||||
+
|
||||
+# On-demand kernel-rt tests
|
||||
+- &kernel-rt-810to98
|
||||
+ <<: *kernel-rt-abstract-8to9-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - kernel-rt
|
||||
+ - kernel-rt-8.10to9.8
|
||||
+ - 8.10to9.8
|
||||
+ identifier: sanity-8.10to9.8-kernel-rt-ondemand
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env:
|
||||
+ <<: *env-810to98
|
||||
+
|
||||
# ###################################################################### #
|
||||
# ############################## 9 TO 10 ################################ #
|
||||
# ###################################################################### #
|
||||
@@ -586,3 +640,68 @@ jobs:
|
||||
- *tmt-env-settings-97to101
|
||||
env:
|
||||
<<: *env-97to101
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.8 > 10.2 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+- &sanity-98to102
|
||||
+ <<: *sanity-abstract-9to10
|
||||
+ trigger: pull_request
|
||||
+ identifier: sanity-9.8to10.2
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8.0-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env: &env-98to102
|
||||
+ SOURCE_RELEASE: "9.8"
|
||||
+ TARGET_RELEASE: "10.2"
|
||||
+
|
||||
+# On-demand minimal beaker tests
|
||||
+- &beaker-minimal-98to102
|
||||
+ <<: *beaker-minimal-9to10-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - beaker-minimal
|
||||
+ - beaker-minimal-9.8to10.2
|
||||
+ - 9.8to10.2
|
||||
+ identifier: sanity-9.8to10.2-beaker-minimal-ondemand
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env:
|
||||
+ <<: *env-98to102
|
||||
+
|
||||
+# On-demand kernel-rt tests
|
||||
+- &kernel-rt-98to102
|
||||
+ <<: *kernel-rt-abstract-9to10-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - kernel-rt
|
||||
+ - kernel-rt-9.8to10.2
|
||||
+ - 9.8to10.2
|
||||
+ identifier: sanity-9.8to10.2-kernel-rt-ondemand
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env:
|
||||
+ <<: *env-98to102
|
||||
+
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/279.pem b/repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
new file mode 100644
|
||||
index 00000000..76336f82
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKDCCBBCgAwIBAgIJALDxRLt/tVBkMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsyOWJlMDI0
|
||||
+My03NGU1LTRiNDctYjEwNy1iZjhkNjRjYmNjNDhdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsTCBrjAJBgNVHRMEAjAAMEMGDCsGAQQBkggJAYIXAQQzDDFSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuMBYGDCsG
|
||||
+AQQBkggJAYIXAgQGDAQxMC4yMBkGDCsGAQQBkggJAYIXAwQJDAdwcGM2NGxlMCkG
|
||||
+DCsGAQQBkggJAYIXBAQZDBdyaGVsLTEwLHJoZWwtMTAtcHBjNjRsZTANBgkqhkiG
|
||||
+9w0BAQsFAAOCAgEAGouNVN3DdCE2cqv3lKMNC3jit5mHi7QQt7fqN/KX4fQfArb6
|
||||
+IQ9M0GaGJM8W9rj+9s+Q9LOFjys24Pcdb9qbQWpfwvn9FY60uQw3TIXAerJaVb98
|
||||
+doxrFHjVptm0/VX2xnOa/dY97dmMT4Amwe5+y4RYlMEsYqY8dpJkVuKNdGtCg+Uf
|
||||
+f9hb6XjDqRevADgskHNprXrjF65Ib3a92qJRfttnVUfqqeDkTPntIPbau9hZwLeR
|
||||
+oMl8pn4kMIYLz1IolSAC8yBFe9sLxllGu8qIFqH4Efzx8BOtHkPUH/VqtgvUej+j
|
||||
+boJ0EEpwYjvYbz00mZmJHFNkUheW6cDUPWmMoTzYibPzRTrBcAIfvybpeuPjFGfl
|
||||
+gYZa/DpEG68hlEnSxB4TNpVCx9qfiqXvNcukmeX3Jr7DS1uC2ePBFDQKewx6WdAa
|
||||
+bAmuANmBUB+NX1WMuNTfxxIzxfIoShaChiFRVjsRTkLo1ZPuMkvXOXYfyfW1PKQN
|
||||
+PXHEdY9wprn8ZY2qhMwmE1sDdndNpSxB3boI9FQBUVDzbSG6KwbPfSdmrte+Wdrh
|
||||
+QCIGU+0x7ulF68yOkMkz1spPNgrTXt0efaCSWqUK0nqv1s1Gh2Q6iJaE0yETpSG7
|
||||
+hFeHpENftckpmuKcJM0v/uBBeIX7X8plrL7Fkm4ND/e61tEiDwvnhxGhtBE=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/362.pem b/repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
new file mode 100644
|
||||
index 00000000..ebeb065c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
@@ -0,0 +1,36 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGNzCCBB+gAwIBAgIJALDxRLt/tVBTMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFthMmU1N2Ix
|
||||
+MS03ZDBiLTRiNGYtOGE5ZC03MmRkNGM2NDA2NzJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBwDCBvTAJBgNVHRMEAjAAMEgGDCsGAQQBkggJAYJqAQQ4DDZSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuIEJldGEw
|
||||
+GwYMKwYBBAGSCAkBgmoCBAsMCTEwLjIgQmV0YTAZBgwrBgEEAZIICQGCagMECQwH
|
||||
+cHBjNjRsZTAuBgwrBgEEAZIICQGCagQEHgwccmhlbC0xMCxyaGVsLTEwLWJldGEt
|
||||
+cHBjNjRsZTANBgkqhkiG9w0BAQsFAAOCAgEAgQC6qqfeW79hSj2S+OfBT5ccNNZa
|
||||
+8blVYtVJU5iTfhX29VQTdGus/ROWGqfgDe8MMOCJyt0eNeqGO70KRJsT3pGeeKcM
|
||||
+UbDfdqzopgD7+/6IL1c1fw/8HijOorW+CMAzeOBdnjMwRjhZxcDlFSqxNCWtngnp
|
||||
+XlDMIlUR3m0rlBwzNfUMk7KYPUESmyEiBWMSKmqRDeiUg3BSP6Ci0x3Ufnf0xTBv
|
||||
+VPVKO/h3ta3+pAYzeFy/ageJ/sR9tLRZQZXzvxYvIY+8/EehafPJCHDHH3uCTpdZ
|
||||
+JAeXDLf2QcOBZnl8uONdev+KaE1JFRCRmqwhliUsARv/t24CY+UBoEzzaj/py2bR
|
||||
+RQqfE5WI1JSdj6HoQ6YHbtR6SF+UedfvMQoSF4zPiXAPNebiIiLkc1rtb/ycUi1f
|
||||
+bUjkRfgRqlDwUcgfHrKhSDp5/XhjgxVXiESNcDe2ltKvVr09qAaPBarLolWeIXkN
|
||||
+n2csdFxyiDZIhk6tFL8lUtpmXWpeEn/iBPwaiBIYoBnIbaqN4OZngwfi2QtTdl+s
|
||||
+9iCuYgbGQiEZnV3g7HLsYXrAagPuJxXs0FMYJZ8x6biREgUQATwTzZMQ8vWRMmYY
|
||||
+kteQBaOCDzNpb8OUgbPxgncl9kgr4NIBn+5oGeMitb+I1XvWqoCFsA7Uii6oygdk
|
||||
+iE+YZEA6e/4057M=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/363.pem b/repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
new file mode 100644
|
||||
index 00000000..865fbda6
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKTCCBBGgAwIBAgIJALDxRLt/tVBSMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0NjJhNDRj
|
||||
+ZC1jNWUzLTQzZGItYTExNy0zZjA5ZGU1ZDRmMzNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsjCBrzAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYJrAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NCBCZXRhMBsGDCsGAQQBkggJAYJr
|
||||
+AgQLDAkxMC4yIEJldGEwGQYMKwYBBAGSCAkBgmsDBAkMB2FhcmNoNjQwLgYMKwYB
|
||||
+BAGSCAkBgmsEBB4MHHJoZWwtMTAscmhlbC0xMC1iZXRhLWFhcmNoNjQwDQYJKoZI
|
||||
+hvcNAQELBQADggIBAC/KEEZ85rdWnL/CK9q3uT/d4reNZc1WD5oWYcpj+J31u4sw
|
||||
+pjAvmq/eA6DmzqGjhfEGhwu5MDbVg77OAPCcfm7qqGSDcnjqnO3ZogDjyzat1WS5
|
||||
+J2uuRcPbF6DIk/LkgIc/FgvSFG8Vc93hM+P56wTzTbnPYSRyJq3BBm8ZjSiFO5jq
|
||||
+V9WOganzxsVKzifTK8RoSdWLyB0JpvL/LZKa4G97ahUctYVilhJBHCgd+uT6/IVn
|
||||
+ppETnw4xo6SXg0+O+fC1P+90+GZrWWzeHeHnEgmZ8B+RTDQbx/KHQHU4UhqU5qnT
|
||||
+6VngqL1453IxmlxVxwKlkwzV4SYrQnmEZPvugMhlenbx0T9pJvwg/xvWYJJTGjUy
|
||||
+1l9p0LtyUHmFJxtbq50++oooUdDtQ6RDD5jtxnvWMF5PFLYGxf6gXFFCJVSgwonP
|
||||
+BtqoBH2PWp8/nwumAOquzks41m+bqzaMALhp0GUGTKKTITrM4gsLVHqKh2WTCOPs
|
||||
+s6mdXOyVma/o5Jri8Ec12/HGyIRlQQleb6vcC68PK3X088LZi/zENi2Bq31W5Hip
|
||||
+R03YxVzmjZA3kJsA8Vim4zaG7e6puLGuXmQLawN7oScBFlvVLvZD2ycZsYLOesCz
|
||||
+VSxJkmqDMb6To9RRbSmN0csPFKWNkdD8D5iBei4IaGWXyOB3GGJJ2ME/Qv65
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/419.pem b/repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
new file mode 100644
|
||||
index 00000000..42986ccc
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGjCCBAKgAwIBAgIJALDxRLt/tVBjMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0MjIwNzhj
|
||||
+OS1mY2MzLTQwMWQtOGM2Yi0yZGUwNWRmZGEyN2NdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBozCBoDAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYMjAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NDAWBgwrBgEEAZIICQGDIwIEBgwE
|
||||
+MTAuMjAZBgwrBgEEAZIICQGDIwMECQwHYWFyY2g2NDApBgwrBgEEAZIICQGDIwQE
|
||||
+GQwXcmhlbC0xMCxyaGVsLTEwLWFhcmNoNjQwDQYJKoZIhvcNAQELBQADggIBAAvn
|
||||
+gY6rJIku70uFkod9Xc45wNgPNMkim2p+dCOQXl5GG7rSLqBp/e6MhBOu+VfvXddF
|
||||
+zEndO84pb7Evc3PjjtnBietvvcmcoJjMTrGF2oKcJWJP+x/SKMzN2qPPoQu4QoZj
|
||||
+OTuaemuHLCkA9cnvRj2qxW9ZpINmr6H72jCHPoYGWD8Omupnctyt3/uu/MG7KT4y
|
||||
+8B5hXLmFeuF1vgOkKnoqjZRgZ86xsJ4dig/vLWkAKdsWPlRlV0SICwgVALqFmTge
|
||||
+Hgrz0A6F2BM7f0vYNFUTRv0qQwHR7EA/jEHCQByNc73cvDtHZFyODTqvEBoLFVOw
|
||||
+2fad9K5EID1GKj9U1NGYAlAvEpbrgs2Xd2ugFyN5mtbSLon+VeXm5q9fB/Ca0j7z
|
||||
+vvfdoKsd89R822m2Y+HB0eei63zGE6Ykr4aaTQNjQyTu5K8pUNG/y5UGWIpSM1IR
|
||||
+YqOsdJvCyavBlQ98K7OfL9yqOiZFXB9VkmXPPiT1ljNgpYzK63ZWidjXkpG2I7g1
|
||||
+YoCIT0JE5xX6x2U5Ia79OFug/g9SwQn6izVYrLCgqqNqeld0WokeFBPnyZkXSYt1
|
||||
+pzY4HAjXjaDGbF1O4SmoCTtagB2vNmi1wUPazizA5SESifVcYfPeaWRk10PJT9MR
|
||||
+p3EFR/BSg/hvmehuGSEfRNFV8g9Deo3EN1LHEhTY
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/433.pem b/repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
new file mode 100644
|
||||
index 00000000..932dbf7a
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGLDCCBBSgAwIBAgIJALDxRLt/tVBUMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsxNzhhMzJi
|
||||
+NC0xZWNjLTRmZDEtOTA2NS0wMGZkMjQzZDEzYzBdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBtTCBsjAJBgNVHRMEAjAAMEEGDCsGAQQBkggJAYMxAQQxDC9SZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIElCTSB6IFN5c3RlbXMgQmV0YTAbBgwrBgEE
|
||||
+AZIICQGDMQIECwwJMTAuMiBCZXRhMBcGDCsGAQQBkggJAYMxAwQHDAVzMzkweDAs
|
||||
+BgwrBgEEAZIICQGDMQQEHAwacmhlbC0xMCxyaGVsLTEwLWJldGEtczM5MHgwDQYJ
|
||||
+KoZIhvcNAQELBQADggIBAAUwQwSc0A1Q5SiC7N5xSS1ZegZQT1hER7SRDs5p6drK
|
||||
+Riayu5bER7kpQnJc/ww1/iTmHHH/H180pSP+EZEPqCLumqYmf1vW60SAR4BMklyh
|
||||
+QuYqVkJCxA7uloA59cLZcPnEu+xHLfnhSQdTIXhi1uLK960mEIiexCT8xMkQ5E5A
|
||||
+ZUajyEhdLp4ca8K+nUWzSzYQBpGYpkiQtniLZ/i4kzaYTfHpFGJNQQCrPlB2lMCa
|
||||
+vZKseaPlFzExXfq5MJ5IX1lc2RNqeaf22p49Bia6CgVLMagsFnAr909zZ9NAaZWV
|
||||
+kYqjLVMJ5EY25OJS21So0fI//lOsRVBxlfqOS7v9hYBnuLhPuiIiHEaNcQyNBI/7
|
||||
+DgT5xCmL8IDzvsBJLZ/AqolO1fo5lSVOZ5PCbwIZj7bBZJwf8gTSUu2cuhbN2Gxi
|
||||
+s7R2QFVco+AAPcuoWOISG4cKwX4wDUR+rHqQMCKJM6mQGlnB2OXBwZX1fYo7k82d
|
||||
+b7BygRhEML6INaweUe2Do7v8phz6TXM2lFJCQYnja2lO6GxSlaXgRNb4Rnc6ty79
|
||||
+O5S6K2g3uEc4Uc8F7echBFAudl9KQqu9il9cb3f0fI+kYX2j9ib4isdF8qIusZVp
|
||||
+F191fHyl1Y6pp4eWKA48uO8Op8uO320UIX8HQnNGi74eEOvCqvZtfKZE5+Za/YT+
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/479.pem b/repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
new file mode 100644
|
||||
index 00000000..2c4b8db2
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGDCCBACgAwIBAgIJALDxRLt/tVBmMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs5OTUxYjVm
|
||||
+NC0yZTE4LTQ1OGEtYTc4ZC05NGNkZDhkN2I1ZWVdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBoTCBnjAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYNfAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NDAWBgwrBgEEAZIICQGDXwIEBgwE
|
||||
+MTAuMjAYBgwrBgEEAZIICQGDXwMECAwGeDg2XzY0MCgGDCsGAQQBkggJAYNfBAQY
|
||||
+DBZyaGVsLTEwLHJoZWwtMTAteDg2XzY0MA0GCSqGSIb3DQEBCwUAA4ICAQDUoyHm
|
||||
+MM07NncLVGO9xO6qa3cxy8NyJO95LScKCAzlx3dHrgW+v1CcxZEzMsV6Rtpch0kH
|
||||
+De61DOCn50JgQ6s7e6Cxk6nMovcxYMi5q4JxYoIlCFTbeRRGdTQv8SmndmSd7rh2
|
||||
+6mDUWoDxbw1fpeNxiWAOq8IQXrcmrEnVIpOQP4Fc+yNw/Sdsqz23o9VBlP0yBJ4W
|
||||
+a6zGCwRzcisLsNOc+8mRtuirG11Zqm07V0xt2YVXlV13Wu/Dy0qKW49tPJD8WceO
|
||||
+hCC/alSRh1s4YV50gVlA0IRyyezAwU/0Al+lMKfMeqqedg81QGMBiy6qzDjXllcK
|
||||
+XfKYsWC2egkofpvxb5jVU0EXdl0kE+RGQfK3fVq09YwNim41n9qgJTlA1vIBrq8o
|
||||
+1NMwyrbQdfndyGZLSpzWxLHpYUCe2lJomgJTNvrA6+xTnlpfEPOn2zDUxJ7CSfoQ
|
||||
+ZkPhdO4UsrvJOPLt5oY5R5Q6tXLVR7xL24WeUw5FXtzFMibOaE3kT9ib0o8zluMS
|
||||
+ly290tfnl8Wq7fgjFT8mt0NIH/rXC4COBw87EjLbhxUCbEHnbJiOj+JT2QRxKjWg
|
||||
+9icCBbU5TEY0V8rC+vx54JCcx8NGaJDDKDmv6tgEOA0u9YEpGw44fk6RxqeNaysW
|
||||
+glkF2dUoSBDKWSqiroYrjEgaFWvdSaalOSJQuA==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/486.pem b/repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
new file mode 100644
|
||||
index 00000000..181b7a98
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJzCCBA+gAwIBAgIJALDxRLt/tVBVMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs2OWQ5ZGY5
|
||||
+Yy1mMGFmLTRjY2UtYTRhMi0zZDA4MDM1YjJmYjFdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsDCBrTAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYNmAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NCBCZXRhMBsGDCsGAQQBkggJAYNm
|
||||
+AgQLDAkxMC4yIEJldGEwGAYMKwYBBAGSCAkBg2YDBAgMBng4Nl82NDAtBgwrBgEE
|
||||
+AZIICQGDZgQEHQwbcmhlbC0xMCxyaGVsLTEwLWJldGEteDg2XzY0MA0GCSqGSIb3
|
||||
+DQEBCwUAA4ICAQA00Q5BALEU5y1CJwF7ru1xNujrtjZvwOdXeNl+esZIqlZQqITP
|
||||
+Rr6Xww0/mcMcvqEHu/PlJ2xyWC8VYrhZ+/LC6EtTbPEKSDEAHE914MU934pC02tP
|
||||
+QE+a7BKsHPGhh4SyvMrZ0vWoxnwcug5g8V5uXNOQYSgnOAHdNQxMeMh8LCHO76np
|
||||
+fjWL7en5dUMWHOB9W1kyZO87f2WBGhFrTyNnFTcg99G/MNMkMD5rLc+Qg8GhY1Zt
|
||||
+8+AN4c5HprFI1cUz8/4osj2ZBW1xxH+mcps2oy3L8UNFceiAdewVpTmwlBN0HEUk
|
||||
+3+NB64+QXLf13EowJnAunJrVms+bQbB1Y2zOL1ymiCLF6iQu4mIdEP2yqzk7lowa
|
||||
+RmuxEOI/S279n+YtilUuWKoeaLcGqPd0rPS5B01M049+KXW0Vv/6OOakA0rltB76
|
||||
++RBeE4UTnPCOIBfyVCHdoCTDFaI5GavVZGTr1bLQR9FdIRzQs+nx3VUYf6o2ZHOW
|
||||
+R1I794GHADaLwNfD5b5oo1XwIkuDxcvrF5kFlhnI3X9cVFDhk6uvMTzKEHPsdoYY
|
||||
+Oe2PdTNfyaiAZs5RzE7If+DAK1zCHrO3GHN4tRyQEwG5p/1F91iw2/Kj67zosH38
|
||||
+Wvm4FSL0ENRPIIUt+p0zT4FBPXOr4YwQGBn0PuaIob5mymAdbUI6Q3CHqA==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/72.pem b/repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
new file mode 100644
|
||||
index 00000000..3d15c146
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGTCCBAGgAwIBAgIJALDxRLt/tVBlMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtmM2M4ZTQ0
|
||||
+OC1lYmY4LTQxN2MtOTI5My01ZmE5NjU2YTI4YjJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBojCBnzAJBgNVHRMEAjAAMDsGCysGAQQBkggJAUgBBCwMKlJlZCBIYXQg
|
||||
+RW50ZXJwcmlzZSBMaW51eCBmb3IgSUJNIHogU3lzdGVtczAVBgsrBgEEAZIICQFI
|
||||
+AgQGDAQxMC4yMBYGCysGAQQBkggJAUgDBAcMBXMzOTB4MCYGCysGAQQBkggJAUgE
|
||||
+BBcMFXJoZWwtMTAscmhlbC0xMC1zMzkweDANBgkqhkiG9w0BAQsFAAOCAgEAMT/B
|
||||
+VjMEkJIvwAShBe9XhWj1lNvd58VQNaet8eMebCOy2CN32v50zquH9QgQH4Sf/aBm
|
||||
+X8HfQWl23zAQApCjMr2Sawmjmy05Oj7UGghkbANDvwHV2VKg1nOIoy4oaRvQj86m
|
||||
+Hn7g0t4Iz1/kTCioZkRgj1PULeDKa7u/GKiYgpc1HVjxUUwJsC2JQwjZ1CwRsNPc
|
||||
+AV6sDLveJn0doggYrxbC/+9oGYSxxUrkvaPzMmuvHa5F50NHuwgcNTL47uVkglIV
|
||||
++GBQaBaOq9c/8yWbqLVVDbXu1JD6zgzGj6BYiziJEpU7cqYfCOF9qPIYTD9AnZLx
|
||||
+43LHz33E6dRRCD9yTuMQEHE3uUoFi/G+yQvf/paSddE5FBX2d35jPSKk5um/x30g
|
||||
+EiFhQKSuHqWIz/cfucwFBQJRHIPj/yN93RqE9u+uJQrSk8KorEg3fVTumBT6bTYh
|
||||
+QprOvJBrV6UZg7oHnUC9byiyHzHRHktHv2HOPGbywbIZd0TM5R0KWaEQEVg0OAJG
|
||||
+KgwEeuiEufQZGq29EZTEtyDpDIP9wNiC4pBHe9B1UpE6EdzfoZWlJb6wbUMRtTqw
|
||||
+RS1ijNAFzvYy2Yuz0/aRi163qek95YwoXeeZn2QbDN+YgFjJZq6pHjNxYTyDthos
|
||||
+uWfveDk3xJRFp+Ja5WbgEK9FxzdFz34OZKFlre4=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/279.pem b/repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
new file mode 100644
|
||||
index 00000000..8757b9b0
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJTCCBA2gAwIBAgIJALDxRLt/tVAaMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtkZDJiN2Jk
|
||||
+OS01NmJkLTQ3YzctOWQxOS1jNWYyNmE5YWQwZTJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrjCBqzAJBgNVHRMEAjAAMEMGDCsGAQQBkggJAYIXAQQzDDFSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuMBUGDCsG
|
||||
+AQQBkggJAYIXAgQFDAM5LjgwGQYMKwYBBAGSCAkBghcDBAkMB3BwYzY0bGUwJwYM
|
||||
+KwYBBAGSCAkBghcEBBcMFXJoZWwtOSxyaGVsLTktcHBjNjRsZTANBgkqhkiG9w0B
|
||||
+AQsFAAOCAgEAEzlRfJCOY32tUEuMY4Z/cBUoJjM3/IoKY+7tA1xjzNWzL0hPWXcP
|
||||
+Ifb2iYXG7rINxRkGk56PiFYReGjxlkhkUWRiciAZc6oHfbpw3IyeWnCgSHJXQqTc
|
||||
+kUEWcUG0CJOlE9OBegvqK+PSydRx2JYhaAFza3zMvIYrdtmOvqhP3/GvuN+nnI4G
|
||||
+F7GgJkOyalbaSTOWlH2+wxuXeAnlEtUTytRFBEsBywuyi6NIpBL6Oj+QoBFQdCOE
|
||||
+Ot2Q3v0N4Q5+aiu5UsYPHs97NV8DPkuA0I2qDZr9j/PgxwftbMt14QHG+G9LW3Cz
|
||||
+DSRIXeKfXGo0GbR7E4ZZBLpp/3LMmH5w/K13skoGtnfWC5x/yoHFRPGmSb1Rrzx2
|
||||
+kre8EMrXrFFZn4hXu/huQwLTxpg8Hn5pPzDphEksTKQxLeUF0lRj5b3NtqJbQ4he
|
||||
+NDBAA9cgpifdfaFO8Ax/zppiUeoEizAyst4FFGMDC5u4EFPNQJLjh6vc/2rvP1bk
|
||||
+KwH2FRxd/jyCcu6bEF4Fv/O/dpddkYtmSPQs3DLX9g9N30uOdOp9TM3W9lt/HFQE
|
||||
+VpqG7mXTu+f4hx5LFqJXR1pSLzCjVPl03sVi05rjD0Tjkt//pRybpzf/66wMQ1wE
|
||||
+LWoT869L+7EiL5aSPE3dX7D6IsNzqHvIPKuFAO8T2ZXdiwidAlpXlyA=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/362.pem b/repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
new file mode 100644
|
||||
index 00000000..cb1b7c00
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
@@ -0,0 +1,36 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGNDCCBBygAwIBAgIJALDxRLt/tVAGMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFswMGIwYzc0
|
||||
+MS0xMDQyLTRiZGUtOTYyYy1kZjRjOGVlMmNiNjBdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBvTCBujAJBgNVHRMEAjAAMEgGDCsGAQQBkggJAYJqAQQ4DDZSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuIEJldGEw
|
||||
+GgYMKwYBBAGSCAkBgmoCBAoMCDkuOCBCZXRhMBkGDCsGAQQBkggJAYJqAwQJDAdw
|
||||
+cGM2NGxlMCwGDCsGAQQBkggJAYJqBAQcDBpyaGVsLTkscmhlbC05LWJldGEtcHBj
|
||||
+NjRsZTANBgkqhkiG9w0BAQsFAAOCAgEAvtSvgFTBFe30H/WQcgvDjJe2ucROmr6B
|
||||
+AW3OF3hvamcwciLMjzMgVyf4dwRDCsKL0q9cRmFXlMR0H36iNQnYkZU1p/sWfCIB
|
||||
+HtPDPlSr3miELB6FTvod/L4zn+CqbjgN2D3wJJKVfldbQzOTV3kEFed96yB8exTV
|
||||
+ObdCIzyadhtULog9mtUCe+8IxG8oDzpjAaaYfwkyq6tY3VzbvRS76292yFVQe6rG
|
||||
+wc9kxhwCfprnvzH7+dTlbMJlvk7PQB7xH1CvSmrIf7C5tfLf/BrsygFtqnq8KLTx
|
||||
+v644hMGkOvMBdEw5Ry3jMPAlmL+Eyc5751XkN3b5yujXA+T71t1/F0i99DM8XTO8
|
||||
+WovLAH4KjX+gvHugdsEQs0ujRpxPDgkv9/RFWs0kkBgzhUlFqOGBsi3HyGoqq770
|
||||
+/e4Fvnj/XxHzs4G3FgiyGnsKLOaKm7eFTwhePsscIckGr/6oq7U0VQF1xOc77I7n
|
||||
+uPFdSXso5TUUO2UVhqmeq71hhj000wpw4vKQ71rEfgTtMiC7Et93hpk4y4iwuk9w
|
||||
+mDGTksyr50QNgS9ZNWGLu2JejT3s9RcjROEJ6VOWJxorDWxEY/LXl683FtRXPEM2
|
||||
+UjHyhx8twhxbIlcD3a8S0R4BfcWCLvhtpdnmOtFGACYMaYd9TAdOG/AZoc/jBOpy
|
||||
+s2OKIQwKXPY=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/363.pem b/repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
new file mode 100644
|
||||
index 00000000..fa09ec7c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJjCCBA6gAwIBAgIJALDxRLt/tVAFMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0MTFmZDc4
|
||||
+NC00ZTc4LTQ5YWQtOTNiOC0zNjc2OWY0ZDFlZTVdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrzCBrDAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYJrAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NCBCZXRhMBoGDCsGAQQBkggJAYJr
|
||||
+AgQKDAg5LjggQmV0YTAZBgwrBgEEAZIICQGCawMECQwHYWFyY2g2NDAsBgwrBgEE
|
||||
+AZIICQGCawQEHAwacmhlbC05LHJoZWwtOS1iZXRhLWFhcmNoNjQwDQYJKoZIhvcN
|
||||
+AQELBQADggIBAFzGv13LCdYf3XkOt3TjwVwY2ldFVMxf2Sx/uNjLFG4I1mhYwZZ9
|
||||
+0Pyz7J771yMxyhyKb8rc8XMAYxi8lOKfOpp1PpPRVC+NtKo2pdrbZhWy2qKomfyL
|
||||
+S6jN/hEgg7P6LHGEnvT1Bm9e+BoED3gmOVAmupL4xKv2eRxgXuwuPHrvE6oo63SB
|
||||
+xtrYIo/pmYgVFgl/d7X5vXqerF4pwLR2DwtK6O84DSyVRf35ghNET09GYm6G+URQ
|
||||
+eGWi1/h0YCpS9LCXOOOv/J4MM8zr+NLbDyJWxmaG83/zvAQhX65bzJ0bBtb0avJ0
|
||||
+cgos6LBCDxt+kmipnAMqz5Cb+HVifgdBz1ep3EcoxHwmwBDpHewq0zNtPgMyjzhi
|
||||
+uwB0inlcCk7JKdjdO36H7RdUYvrM7WEDUKAXtMgOXxr3o6h9v9jZKTfbk5Af91/D
|
||||
+epoMULy0sErnEuzHAq9sdh3HTmDTHsMNcUpxwC+93VGaCGGrbyM2yQtdLg7dhHQK
|
||||
+7d9Z9BJEzKReIy+R354M1jQsLGLQ3B8uY476dmP0G0Q01m86rsJ/gjxa8vrJpafO
|
||||
+t1Up9YexwbVtEtKG7koCz4fwxPv2cauGncuUTdyHJDoS5FpPLMlaWXAfwD0Udbiv
|
||||
+gZke/PD+39I+UPrxtM+XIXGoJPeZdM5Kv0+3/suvKHGqtkFa8YiK2EHA
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/419.pem b/repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
new file mode 100644
|
||||
index 00000000..9ad33fd1
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFzCCA/+gAwIBAgIJALDxRLt/tVAZMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtiOWY4OWYx
|
||||
+OC0xNjAzLTRlZDUtYTFmOS0xN2YyMmEwNDdlODNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBoDCBnTAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYMjAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NDAVBgwrBgEEAZIICQGDIwIEBQwD
|
||||
+OS44MBkGDCsGAQQBkggJAYMjAwQJDAdhYXJjaDY0MCcGDCsGAQQBkggJAYMjBAQX
|
||||
+DBVyaGVsLTkscmhlbC05LWFhcmNoNjQwDQYJKoZIhvcNAQELBQADggIBAFu1LxAU
|
||||
+wPUs7/e6mFAzT/JIzq1fQ6kMHxbrf9nS+g9pO0G0z7Imwj85Rk7qOpJpEjKaLVDy
|
||||
+OJ9fXV20TNidKDvjZuL+F209NLam64MEpy7q40LgOaDYsr9tvGfJJFAQRKRszbrC
|
||||
+/CGj7l/q09ym1FB3LXgpn4vHR8jD7LloGFEWq19UpRLe+L+1Frh16apy03WNYTnk
|
||||
+JLALo274I3+kgO69sEemXZF+WD/O+4ySugY/ImbrIlrY1SAeAWTd/kudLMLVLYnN
|
||||
+JlmB7OPUGE2ZAR0aOTvTeoDBZPz1EGItbJg2hlx4vrhrnGG9kKu+/cDOOAJ7+bgx
|
||||
+fgc64NOoLTSc+9QIgKKhDt5jShXHfFjpwWbJ08/U29bTZmntcRO0h6F0WBS3ptgW
|
||||
+hocfN2nDN7pPvivnrUUo+kRY7jKE57im3+mznHHw97em6YCREuvc/NwLIxi4LSiU
|
||||
+cJgOQ3ltljrFSMKlv4p6evMxlX/QOwgeE+hf/QYjCODoHe/66h5bnKkLGnFdPHxk
|
||||
+6btQfVePn8UpMUO64OgIcPuGyAEXu1m9N/PFL3S5JUVmfjF9COhmZQEW1x5HBF/u
|
||||
+mAfwI79++xKH1nmVsgDUjm5HMVZ3qj0y3miAKtC3Ses9Ym6JawpvPSld3xFGF5Mc
|
||||
+BiYQsv12swSrLy3IzdvJViXRFUFE3dWuVdG1
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/433.pem b/repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
new file mode 100644
|
||||
index 00000000..eaf93d90
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKTCCBBGgAwIBAgIJALDxRLt/tVAHMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsyYjk5MzMx
|
||||
+OC0xZjFiLTRlY2UtODJiMS0wODEzYmFjOGFkNGJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsjCBrzAJBgNVHRMEAjAAMEEGDCsGAQQBkggJAYMxAQQxDC9SZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIElCTSB6IFN5c3RlbXMgQmV0YTAaBgwrBgEE
|
||||
+AZIICQGDMQIECgwIOS44IEJldGEwFwYMKwYBBAGSCAkBgzEDBAcMBXMzOTB4MCoG
|
||||
+DCsGAQQBkggJAYMxBAQaDBhyaGVsLTkscmhlbC05LWJldGEtczM5MHgwDQYJKoZI
|
||||
+hvcNAQELBQADggIBACjKAgygB5V2mVD3S5snrHjFTpP2x1ODX1GdSgwrXFZ/ehom
|
||||
+hf1SI9zIsmm+s96ns/Gc5BDrqS2TSil083OqG5YZ98ap+NkQPI/XqIhMRSw2z+QK
|
||||
+p1i7e/Si6VZyiitnutCrbX/b1RzWCSOAfIU2m41iptvT7HATw0y/6CQpQNrhZ3wR
|
||||
+TubEIEypmxO5stJt4CO/bqkU3vX+U3FdQdSJWJn3qpvErJ4qNFdwl8zX9WGoaueh
|
||||
+gNbYrz2EWARVbvedp+ylB1VNdpYXQ+LUI/KwHI4Sxizgg16+IxcFoKJVCYNOH7Wh
|
||||
+IoMZc7eW91oAzm57yS36RF/Z50S1x8JHHg2hgev+2czDG9dgRTsLvvAXqsnrUHuD
|
||||
+lRPMDjgaSooUWJmKwIXQ7yJDAPHoxZAXWtMEc1kNLZGEPVDQbT73j4eDOxzZDZrr
|
||||
+agWGoWJ3kuY9AVvv/RTi6z5VWs7ySJER7RxQcGhH8TctysW7gIMjHfgnTGN2bW5U
|
||||
+mV5Ds+/i9AiA9/V+rWWsv8riz+MfEa23/J/EvOdBBCd5MuzsqkXn2gde8WP3cjes
|
||||
+sgqUKQzOy7Rqr5LHT1IQl5SkyYr1QV1InghJ8dh7BjRLvWUaw0uqPRvxX1c6K1l/
|
||||
+NFsCie9RwuhdE8OBwHuBjB28k3Zs9SPaVzYRe70qwi0epbCrhwcGOkTNfCcz
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/479.pem b/repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
new file mode 100644
|
||||
index 00000000..a0ff7061
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFTCCA/2gAwIBAgIJALDxRLt/tVAcMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs4ZmM5YTM4
|
||||
+Ni0wYzkzLTQ0MjctYTlhOC1kMTdkMzAwZGJmZDZdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBnjCBmzAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYNfAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NDAVBgwrBgEEAZIICQGDXwIEBQwD
|
||||
+OS44MBgGDCsGAQQBkggJAYNfAwQIDAZ4ODZfNjQwJgYMKwYBBAGSCAkBg18EBBYM
|
||||
+FHJoZWwtOSxyaGVsLTkteDg2XzY0MA0GCSqGSIb3DQEBCwUAA4ICAQC6vt8EEay9
|
||||
+CjdRGHmseXosuo03ub+bUt61uYVpf15IoVUV+7XT6ZHff8cPZbKBjoRbuWNILvR2
|
||||
+rCdl11bm3prCxfLNJh5u8hqNXv+iIB4k4qhCSrhPFQEf3HNJma2J67U/8Mt7oM4B
|
||||
+RqpZ1CCw9VTHQSB+iraKzE+BFr9kNlQfZu75Clsgv5dZaT1WK5hKiuQy8kc2CBKy
|
||||
+CuiL6i0PK2tzNtNH4ON/tMU3AM+edIiUFV6C376kewwO/omArY6FYmJVcPLKWh3h
|
||||
+TSUt81CmaHmyW+XKJ2pM3f2hfHdq1Lf7lInjgw5Rolyhm/Xqrrj8j19SrUSru/tw
|
||||
+WcmLMhhEyU2/jwfipbbzB9AC3tIXZjKv8539e4omsBmHwHQno1NAjq0+alGxr9pK
|
||||
+AZywsuMhiGyznbYdIANGZyMUN3sULIsG649UcEsmzM5q9g1TVyuJH9m+OJSK2PGk
|
||||
+UnorgDlGs1AiJhsqZuW8zxzy3nfQmniO/o/6wZbqlKiyLjQY7Fxa4Rb0hXbBJkZ7
|
||||
+TkHkjlAObUEkcjg0jUHb8sFRQ7hXx+Tk4tGk549crSZCCg951SITV5By9bAxm7fu
|
||||
+DHGXgY7tOwHII51sfBfryuvIKs+JmzF9Evzssf3kLBSXylyS6pr/8dKN6sF7Pw4M
|
||||
+Fe/gvJ3J/pARSVP41wR6tI0zYvqkO/ULQg==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/486.pem b/repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
new file mode 100644
|
||||
index 00000000..84461ed8
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJDCCBAygAwIBAgIJALDxRLt/tVAIMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtkZjUwNWIw
|
||||
+ZS02Y2E4LTRkODQtOTY0Mi0wNGRlYTg5NjY0MzNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrTCBqjAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYNmAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NCBCZXRhMBoGDCsGAQQBkggJAYNm
|
||||
+AgQKDAg5LjggQmV0YTAYBgwrBgEEAZIICQGDZgMECAwGeDg2XzY0MCsGDCsGAQQB
|
||||
+kggJAYNmBAQbDBlyaGVsLTkscmhlbC05LWJldGEteDg2XzY0MA0GCSqGSIb3DQEB
|
||||
+CwUAA4ICAQCNeDKnDjuvHBE0Fa0cMAFM96OWn3b3wTtAx7i9BCaCe4NsRTjEMJTw
|
||||
+jO4KwkfzCQWpOJuFHnOKmVZBXVZZ8aOLCfYTyQZ6nZ1UsiekL7l9sdIFCHrbgKkL
|
||||
+zBFe+8cVtUMwb9f7fORPp960ImtYpvt8ERihHf2LvIBUI+BGRz/D/3NW1ehVggGI
|
||||
+0VCe270sgLSl3y8lR5BrNXtKbigeI4mNMasndf/TDMFeCk5OH4FJ+DyiY0zma2IT
|
||||
+x0PwQmEeI4my1KTmQSUDgIOmHtKbq1tCR2wMIh/ju/HOrvVeOnzEsBgQTiTh92qJ
|
||||
+U7/++7Ayqw/6PfPCd+gOMqIPS1+Aef7w54I+zWyYeHQcXXCxcffPwO7sZV3zQJyh
|
||||
+clfLJv13Oe6G5mB7ZCH+tB4LdaVBURz9G0MkLwXGfTWfnU5N61Kne8hjOriSBWP4
|
||||
+2FZEP+2BQ/1Z7aIssbQKegdRvvMd/KqJjIeiFtrz9AVSodEUZgJlxiZ9KDSysG18
|
||||
+hmZcPuk2mc9nwWQ9gHZWzatGs+uONS92QqFvXxlY7TWMDIdlscubcjV/bbDHm69P
|
||||
++pqGilb3zJz8msBwFpdO+h4l8eUMMMsLzdUdH499q/enZrH3VSdmNtWtoVm9R7rp
|
||||
+khFJ4DdORE9/P5lfqAObt8KNO72BQ2/KcK0FZ1lLxKWG/4dZ5oAdGw==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/72.pem b/repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
new file mode 100644
|
||||
index 00000000..724e0a62
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFjCCA/6gAwIBAgIJALDxRLt/tVAbMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtlYjMyYzY1
|
||||
+Ny00OGY0LTRiZjUtYmY3Yy1mYjMwNWU1YjgyMDFdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBnzCBnDAJBgNVHRMEAjAAMDsGCysGAQQBkggJAUgBBCwMKlJlZCBIYXQg
|
||||
+RW50ZXJwcmlzZSBMaW51eCBmb3IgSUJNIHogU3lzdGVtczAUBgsrBgEEAZIICQFI
|
||||
+AgQFDAM5LjgwFgYLKwYBBAGSCAkBSAMEBwwFczM5MHgwJAYLKwYBBAGSCAkBSAQE
|
||||
+FQwTcmhlbC05LHJoZWwtOS1zMzkweDANBgkqhkiG9w0BAQsFAAOCAgEADCKqieee
|
||||
+Hvj06J4U23K/Wr5zn+d6AtA2vfhpicAYh5jzYqLAJHmB9T5Ql6pFqJ9lMLI2EGSg
|
||||
+jhLD+lzDP9A2vk+rFWK0BEGnqlPrQtM5atTBeihRVRci1ymspPBrLwu+Zu3jromg
|
||||
+I14r86EZwSXpPZLaNUsOjOi4Euc50Q3wsUJGvXCpoU4SgnnAIER3lq9HSNFDZkmp
|
||||
+AjW+VHAhPIOTujm9PhCFIn5bB0jsygHHYyqV7KvQSmxoPTaLMxFpva+Xy0QNKlwg
|
||||
+NXKw/JYAHX1yaskeZviqwZzhKpnvycyEgWF9f7cBD6O8Adxx9qkqXqer7YsQ/wgR
|
||||
+cHjGCAKbV2OTIgyQEDie1gdPLdSUPzrbzJ9C1I85tSJH3ujdACiGG/aHPtspLb3Z
|
||||
+M6265fbXDbXOqjFuP/njDUqal3WgUgw34w4Xi2JLCcqLvHLQhTmZSKiD0SJbRDL1
|
||||
+smcle/yKhTc4+7zJqQV8faR9LVEAkaLzjG3ZRiTUDq4RASr9tN/A0AfXqggG9nGL
|
||||
+06m6QcXRxHM0OVgLHLksKsj3rG3VX0v3aQm353GW1sxxX0hqFnoOnGWA410GUG9S
|
||||
+rg897hshyti1pn045uhhFjbpxYRKu/JY9VNNyRW0KqL1hyz4TY7OQxJxGDAPX7uJ
|
||||
+7NGSWW9EsYMZNMxEee6br9lWVwGWnc8DWhA=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/upgrade_paths.json b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
index 22e0fd7d..61bb73c0 100644
|
||||
--- a/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
+++ b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
@@ -2,9 +2,10 @@
|
||||
"rhel": {
|
||||
"default": {
|
||||
"7.9": ["8.10"],
|
||||
- "8.10": ["9.4", "9.6", "9.7"],
|
||||
+ "8.10": ["9.4", "9.6", "9.7", "9.8"],
|
||||
"9.6": ["10.0"],
|
||||
"9.7": ["10.1"],
|
||||
+ "9.8": ["10.2"],
|
||||
"7": ["8.10"],
|
||||
"8": ["9.4", "9.6"],
|
||||
"9": ["10.0"]
|
||||
@@ -15,6 +16,7 @@
|
||||
"8.10": ["9.6", "9.4"],
|
||||
"8": ["9.6", "9.4"],
|
||||
"9.6": ["10.0"],
|
||||
+ "9.8": ["10.2"],
|
||||
"9": ["10.0"]
|
||||
}
|
||||
},
|
||||
@@ -25,13 +27,13 @@
|
||||
},
|
||||
"_virtual_versions": {
|
||||
"8": "8.10",
|
||||
- "9": "9.7",
|
||||
- "10": "10.1"
|
||||
+ "9": "9.8",
|
||||
+ "10": "10.2"
|
||||
}
|
||||
},
|
||||
"almalinux": {
|
||||
"default": {
|
||||
- "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7"],
|
||||
+ "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7","9.8"],
|
||||
"9.7": ["10.0", "10.1"]
|
||||
}
|
||||
}
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
From b41d5b386f3369cf714cff9f3277863f6f601bc1 Mon Sep 17 00:00:00 2001
|
||||
From: denli <denli@redhat.com>
|
||||
Date: Mon, 6 Oct 2025 12:25:07 -0400
|
||||
Subject: [PATCH 22/55] Add kpatch actor to el9toel10
|
||||
|
||||
---
|
||||
.../actors/kernel/checkkpatch/actor.py | 29 +++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..e7f6179c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
@@ -0,0 +1,29 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import CopyFile, DistributionSignedRPM, TargetUserSpacePreupgradeTasks
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+PLUGIN_PKGNAME = "kpatch-dnf"
|
||||
+CONFIG_PATH = "/etc/dnf/plugins/kpatch.conf"
|
||||
+
|
||||
+
|
||||
+class CheckKpatch(Actor):
|
||||
+ """
|
||||
+ Carry over kpatch-dnf and it's config into the container
|
||||
+
|
||||
+ Check is kpatch-dnf plugin is installed and if it is, install it and copy
|
||||
+ over the config file so that the plugin can make a decision on whether any
|
||||
+ kpatch-patch packages need to be installed during in-place upgrade.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_kpatch'
|
||||
+ consumes = (DistributionSignedRPM,)
|
||||
+ produces = (TargetUserSpacePreupgradeTasks,)
|
||||
+ tags = (IPUWorkflowTag, ChecksPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ if has_package(DistributionSignedRPM, PLUGIN_PKGNAME):
|
||||
+ api.produce(TargetUserSpacePreupgradeTasks(
|
||||
+ install_rpms=[PLUGIN_PKGNAME],
|
||||
+ copy_files=[CopyFile(src=CONFIG_PATH)]))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
From 0cf9d8adb12b40f4cdcd423e6c55c11e0fbacff5 Mon Sep 17 00:00:00 2001
|
||||
From: denli <denli@redhat.com>
|
||||
Date: Tue, 7 Oct 2025 08:09:58 -0400
|
||||
Subject: [PATCH 23/55] move kpatch actor to common repo
|
||||
|
||||
---
|
||||
.../actors/kernel/checkkpatch/actor.py | 0
|
||||
.../actors/kernel/checkkpatch/actor.py | 29 -------------------
|
||||
2 files changed, 29 deletions(-)
|
||||
rename repos/system_upgrade/{el8toel9 => common}/actors/kernel/checkkpatch/actor.py (100%)
|
||||
delete mode 100644 repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/common/actors/kernel/checkkpatch/actor.py
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/el8toel9/actors/kernel/checkkpatch/actor.py
|
||||
rename to repos/system_upgrade/common/actors/kernel/checkkpatch/actor.py
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
deleted file mode 100644
|
||||
index e7f6179c..00000000
|
||||
--- a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
+++ /dev/null
|
||||
@@ -1,29 +0,0 @@
|
||||
-from leapp.actors import Actor
|
||||
-from leapp.libraries.common.rpms import has_package
|
||||
-from leapp.libraries.stdlib import api
|
||||
-from leapp.models import CopyFile, DistributionSignedRPM, TargetUserSpacePreupgradeTasks
|
||||
-from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
-
|
||||
-PLUGIN_PKGNAME = "kpatch-dnf"
|
||||
-CONFIG_PATH = "/etc/dnf/plugins/kpatch.conf"
|
||||
-
|
||||
-
|
||||
-class CheckKpatch(Actor):
|
||||
- """
|
||||
- Carry over kpatch-dnf and it's config into the container
|
||||
-
|
||||
- Check is kpatch-dnf plugin is installed and if it is, install it and copy
|
||||
- over the config file so that the plugin can make a decision on whether any
|
||||
- kpatch-patch packages need to be installed during in-place upgrade.
|
||||
- """
|
||||
-
|
||||
- name = 'check_kpatch'
|
||||
- consumes = (DistributionSignedRPM,)
|
||||
- produces = (TargetUserSpacePreupgradeTasks,)
|
||||
- tags = (IPUWorkflowTag, ChecksPhaseTag)
|
||||
-
|
||||
- def process(self):
|
||||
- if has_package(DistributionSignedRPM, PLUGIN_PKGNAME):
|
||||
- api.produce(TargetUserSpacePreupgradeTasks(
|
||||
- install_rpms=[PLUGIN_PKGNAME],
|
||||
- copy_files=[CopyFile(src=CONFIG_PATH)]))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
From 3128ca5df81b4c7591af189c9e2ae02f96c88fb4 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 09:00:20 +0200
|
||||
Subject: [PATCH 24/55] Makefile: Do not copy unnecessary files to test
|
||||
containers
|
||||
|
||||
In addition to tut/, docs/, packaging/, .git/ and all the __pycache__
|
||||
directories (and .pyc files) are excluded. This makes for a significant
|
||||
speedup in container setup (output with -v added to rsync) as a lot less
|
||||
needs to be copied:
|
||||
|
||||
Without this patch:
|
||||
sent 2,405,488 bytes received 19,754 bytes 194,019.36 bytes/sec
|
||||
total size is 165,333,162 speedup is 68.17
|
||||
|
||||
With this patch:
|
||||
sent 551,179 bytes received 4,067 bytes 100,953.82 bytes/sec
|
||||
total size is 23,280,513 speedup is 41.93
|
||||
|
||||
Some other small files and directories are still unnecessarily copied,
|
||||
but those don't really affect the copied size that much.
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 754c2c63..1bfbc3ac 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,7 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude "tut*" /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
python3.6) \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From 7d9ae2c0adcef2eac7cb09fd9acf74f9a6011d64 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 09:08:02 +0200
|
||||
Subject: [PATCH 25/55] Makefile: Properly copy commands dir to test containers
|
||||
|
||||
During a containerized tests run, the commands/ directory is not used
|
||||
when running the commands tests. Instead, the commands are imported from
|
||||
tut/lib/python3.X/site-packages/leapp/cli/commands/ where python3.X is
|
||||
the python used in the tut/ virtualenv.
|
||||
|
||||
When there are changes breaking the commands tests, the test are still
|
||||
passing because the files are not being updated in the directory
|
||||
mentioned above. This can be currently fixed by rebuilding the container
|
||||
which takes a lot of time.
|
||||
|
||||
This patch adds copying of the commands/ dir to the
|
||||
tut/lib/python3.X/site-packages/leapp/cli/commands/.
|
||||
|
||||
This helped while working on #1438 because I caught the failing tests
|
||||
only after opening a the PR. The CI containerized tests are always
|
||||
created from scratch so it works there.
|
||||
---
|
||||
Makefile | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1bfbc3ac..9774a475 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,8 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' --exclude 'commands/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude '**/__pycache__/' /repo/commands/ /repocopy/tut/lib/$$_VENV/site-packages/leapp/cli/commands/ && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
python3.6) \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From 1ba6d4301602c8a253ba92263fd829e385463182 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 15:19:03 +0200
|
||||
Subject: [PATCH 26/55] livemode: update obsoleted log msg about config
|
||||
|
||||
The original livemode configuration was located in
|
||||
/etc/leapp/files/leapp-livemode.ini
|
||||
|
||||
However, this file has been replaced by new configuration for actors,
|
||||
represented by variable filename under /etc/leapp/actor_conf.d/
|
||||
|
||||
I decided to keep the info log, but dropped the information about the
|
||||
file path.
|
||||
---
|
||||
.../livemode_config_scanner/libraries/scan_livemode_config.py | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py b/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
index 26fd9d09..7d72204c 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
@@ -5,7 +5,6 @@ from leapp.libraries.common.rpms import has_package
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import InstalledRPM, LiveModeConfig
|
||||
|
||||
-LIVEMODE_CONFIG_LOCATION = '/etc/leapp/files/devel-livemode.ini'
|
||||
DEFAULT_SQUASHFS_PATH = '/var/lib/leapp/live-upgrade.img'
|
||||
|
||||
|
||||
@@ -39,8 +38,7 @@ def scan_config_and_emit_message():
|
||||
if not should_scan_config():
|
||||
return
|
||||
|
||||
- api.current_logger().info('Loading livemode config from %s', LIVEMODE_CONFIG_LOCATION)
|
||||
-
|
||||
+ api.current_logger().info('Loading the livemode configuration.')
|
||||
config = api.current_actor().config[livemode_config_lib.LIVEMODE_CONFIG_SECTION]
|
||||
|
||||
# Mapping from model field names to configuration fields - because we might have
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,147 +0,0 @@
|
||||
From 37409349656c12efd4033e0cb5a3c25d10e6630d Mon Sep 17 00:00:00 2001
|
||||
From: Mark Huth <mhuth@redhat.com>
|
||||
Date: Mon, 15 Sep 2025 16:29:02 +1000
|
||||
Subject: [PATCH 27/55] chore(RHINENG-19596): Rebrand Insights to Lightspeed
|
||||
|
||||
---
|
||||
commands/preupgrade/__init__.py | 2 +-
|
||||
commands/upgrade/__init__.py | 2 +-
|
||||
docs/source/configuring-ipu/envars.md | 2 +-
|
||||
.../common/actors/checkinsightsautoregister/actor.py | 2 +-
|
||||
.../libraries/checkinsightsautoregister.py | 5 +++--
|
||||
.../common/actors/insightsautoregister/actor.py | 2 +-
|
||||
.../insightsautoregister/libraries/insightsautoregister.py | 6 +++---
|
||||
.../insightsautoregister/tests/test_insightsautoregister.py | 2 +-
|
||||
8 files changed, 12 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/commands/preupgrade/__init__.py b/commands/preupgrade/__init__.py
|
||||
index 6443bd8a..f24e779a 100644
|
||||
--- a/commands/preupgrade/__init__.py
|
||||
+++ b/commands/preupgrade/__init__.py
|
||||
@@ -26,7 +26,7 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
help='Use only custom repositories and skip actions with Red Hat Subscription Manager.'
|
||||
' This only has effect on Red Hat Enterprise Linux systems.'
|
||||
)
|
||||
-@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Insights')
|
||||
+@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Lightspeed')
|
||||
@command_opt('no-rhsm-facts', is_flag=True, help='Do not store migration information using Red Hat '
|
||||
'Subscription Manager. Automatically implied by --no-rhsm.')
|
||||
@command_opt('enablerepo', action='append', metavar='<repoid>',
|
||||
diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py
|
||||
index 36be0719..c5900c0d 100644
|
||||
--- a/commands/upgrade/__init__.py
|
||||
+++ b/commands/upgrade/__init__.py
|
||||
@@ -32,7 +32,7 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
help='Use only custom repositories and skip actions with Red Hat Subscription Manager.'
|
||||
' This only has effect on Red Hat Enterprise Linux systems.'
|
||||
)
|
||||
-@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Insights')
|
||||
+@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Lightspeed')
|
||||
@command_opt('no-rhsm-facts', is_flag=True, help='Do not store migration information using Red Hat '
|
||||
'Subscription Manager. Automatically implied by --no-rhsm.')
|
||||
@command_opt('enablerepo', action='append', metavar='<repoid>',
|
||||
diff --git a/docs/source/configuring-ipu/envars.md b/docs/source/configuring-ipu/envars.md
|
||||
index a042ba4a..09634df2 100644
|
||||
--- a/docs/source/configuring-ipu/envars.md
|
||||
+++ b/docs/source/configuring-ipu/envars.md
|
||||
@@ -21,7 +21,7 @@ Overrides the automatically detected storage device with GRUB core (e.g. /dev/sd
|
||||
Set to 1 to disable RPM GPG checks (same as yum/dnf –nogpgckeck option). It‘s equivalent to the --nogpgcheck leapp option.
|
||||
|
||||
#### LEAPP_NO_INSIGHTS_REGISTER
|
||||
-If set to `1`, Leapp does not register the system into Red Hat Insights automatically. It‘s equivalent to the --no-insights-register leapp option.
|
||||
+If set to `1`, Leapp does not register the system into Red Hat Lightspeed automatically. It‘s equivalent to the --no-insights-register leapp option.
|
||||
|
||||
#### LEAPP_NO_NETWORK_RENAMING
|
||||
If set to `1`, the actor responsible to handle NICs names ends without doing anything. The actor usually creates UDEV rules to preserve original NICs in case they are changed. However, in some cases it‘s not wanted and it leads in malfunction network configuration (e.g. in case the bonding is configured on the system). It‘s expected that NICs have to be handled manually if needed.
|
||||
diff --git a/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py b/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
index 70b3b670..52108566 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
@@ -7,7 +7,7 @@ from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
class CheckInsightsAutoregister(Actor):
|
||||
"""
|
||||
- Checks if system can be automatically registered into Red Hat Insights
|
||||
+ Checks if system can be automatically registered into Red Hat Lightspeed
|
||||
|
||||
The registration is skipped if NO_INSIGHTS_REGISTER=1 environment variable
|
||||
is set, the --no-insights-register command line argument present. if the
|
||||
diff --git a/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py b/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
index 762f3c08..8e26485b 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
@@ -24,9 +24,9 @@ def _ensure_package(package):
|
||||
def _report_registration_info(installing_client):
|
||||
pkg_msg = " The '{}' package required for the registration will be installed during the upgrade."
|
||||
|
||||
- title = "Automatic registration into Red Hat Insights"
|
||||
+ title = "Automatic registration into Red Hat Lightspeed"
|
||||
summary = (
|
||||
- "After the upgrade, this system will be automatically registered into Red Hat Insights."
|
||||
+ "After the upgrade, this system will be automatically registered into Red Hat Lightspeed."
|
||||
"{}"
|
||||
" To skip the automatic registration, use the '--no-insights-register' command line option or"
|
||||
" set the LEAPP_NO_INSIGHTS_REGISTER environment variable."
|
||||
@@ -38,6 +38,7 @@ def _report_registration_info(installing_client):
|
||||
reporting.Summary(summary),
|
||||
reporting.Severity(reporting.Severity.INFO),
|
||||
reporting.Groups([reporting.Groups.SERVICES]),
|
||||
+ reporting.Key('693963253195f418526f045b6d630a1f4c7a193d'),
|
||||
]
|
||||
)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/actor.py b/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
index a81b434c..56615390 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
@@ -7,7 +7,7 @@ from leapp.tags import FirstBootPhaseTag, IPUWorkflowTag
|
||||
|
||||
class InsightsAutoregister(Actor):
|
||||
"""
|
||||
- Automatically registers system into Red Hat Insights
|
||||
+ Automatically registers system into Red Hat Lightspeed
|
||||
|
||||
The registration is skipped if NO_INSIGHTS_REGISTER=1 environment variable
|
||||
is set, the --no-insights-register command line argument present or the
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py b/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
index 2134a8bb..bd113a1f 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
@@ -6,18 +6,18 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
def _insights_register():
|
||||
try:
|
||||
run(['insights-client', '--register'])
|
||||
- api.current_logger().info('Automatically registered into Red Hat Insights')
|
||||
+ api.current_logger().info('Automatically registered into Red Hat Lightspeed')
|
||||
except (CalledProcessError) as err:
|
||||
# TODO(mmatuska) produce post-upgrade report?
|
||||
api.current_logger().error(
|
||||
- 'Automatic registration into Red Hat Insights failed: {}'.format(err)
|
||||
+ 'Automatic registration into Red Hat Lightspeed failed: {}'.format(err)
|
||||
)
|
||||
|
||||
|
||||
def process():
|
||||
if rhsm.skip_rhsm() or get_env('LEAPP_NO_INSIGHTS_REGISTER', '0') == '1':
|
||||
api.current_logger().debug(
|
||||
- 'Skipping registration into Insights due to --no-insights-register'
|
||||
+ 'Skipping registration into Red Hat Lightspeed due to --no-insights-register'
|
||||
' or LEAPP_NO_INSIGHTS_REGISTER=1 set'
|
||||
)
|
||||
return
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py b/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
index 0a039455..d5e6ba20 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
@@ -41,7 +41,7 @@ def test_insights_register_success_logged(monkeypatch):
|
||||
|
||||
def run_mocked(cmd, **kwargs):
|
||||
return {
|
||||
- 'stdout': 'Successfully registered into Insights',
|
||||
+ 'stdout': 'Successfully registered into Red Hat Lightspeed',
|
||||
'stderr': '',
|
||||
'exit_code': 0
|
||||
}
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,131 +0,0 @@
|
||||
From ddefdee20a97d9b5e08502e4348d92212a702cc7 Mon Sep 17 00:00:00 2001
|
||||
From: Lukas Bezdicka <lbezdick@redhat.com>
|
||||
Date: Fri, 16 Feb 2024 14:58:02 +0100
|
||||
Subject: [PATCH 28/55] [ceph][luks] Fix ceph cephvolumescan for cephadm
|
||||
|
||||
For cephadm the containers are named ceph-<hash>-osd... while
|
||||
ceph-ansible still uses the ceph-osd-...
|
||||
|
||||
Other issue is that OSDs can have multiple volumes in them so filtering
|
||||
just for the first one is wrong and we need to check each volume for
|
||||
the encryption.
|
||||
|
||||
Resolves: rhbz#2264543
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-25838
|
||||
---
|
||||
.../libraries/cephvolumescan.py | 5 +-
|
||||
.../tests/test_cephvolumescan.py | 50 +++++++++++++++++--
|
||||
2 files changed, 50 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py b/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
index b2364104..a9bff005 100644
|
||||
--- a/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
+++ b/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
@@ -8,7 +8,7 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import InstalledRPM
|
||||
|
||||
CEPH_CONF = "/etc/ceph/ceph.conf"
|
||||
-CONTAINER = "ceph-osd"
|
||||
+CONTAINER = "ceph-.*osd"
|
||||
|
||||
|
||||
def select_osd_container(engine):
|
||||
@@ -63,7 +63,8 @@ def encrypted_osds_list():
|
||||
output = get_ceph_lvm_list()
|
||||
if output is not None:
|
||||
try:
|
||||
- result = [output[key][0]['lv_uuid'] for key in output if output[key][0]['tags']['ceph.encrypted']]
|
||||
+ for key in output:
|
||||
+ result.extend([element['lv_uuid'] for element in output[key] if element['tags']['ceph.encrypted']])
|
||||
except KeyError:
|
||||
# TODO: possibly raise a report item with a medium risk factor
|
||||
# TODO: possibly create list of problematic osds, extend the cephinfo
|
||||
diff --git a/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py b/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
index f3811c45..168b8fc2 100644
|
||||
--- a/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
+++ b/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
@@ -8,6 +8,8 @@ from leapp.reporting import Report
|
||||
CONT_PS_COMMAND_OUTPUT = {
|
||||
"stdout":
|
||||
"""CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
+ b5a3d8ef25b9 undercloud-0.ctlplane.redhat.local:8787/rh-osbs/rhceph:5 "-n osd.8 -f --set..." \
|
||||
+ 2 hours ago Up 2 hours ago ceph-bea1a933-0846-4aaa-8223-62cb8cb2873c-osd-8
|
||||
50d96fe72019 registry.redhat.io/rhceph/rhceph-4-rhel8:latest "/opt/ceph-contain..." \
|
||||
2 weeks ago Up 2 weeks ceph-osd-0
|
||||
f93c17b49c40 registry.redhat.io/rhceph/rhceph-4-rhel8:latest "/opt/ceph-contain..." \
|
||||
@@ -41,6 +43,32 @@ CEPH_VOLUME_OUTPUT = {
|
||||
"type":"block",
|
||||
"vg_name":"ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc"
|
||||
}
|
||||
+ ],
|
||||
+ "8":[
|
||||
+ {
|
||||
+ "devices": [
|
||||
+ "/dev/nvme0n1"
|
||||
+ ],
|
||||
+ "lv_name": "osd-db-b04857a0-a2a2-40c3-a490-cbe1f892a76c",
|
||||
+ "lv_uuid": "zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3",
|
||||
+ "tags":{
|
||||
+ "ceph.encrypted":"1"
|
||||
+ },
|
||||
+ "type": "db",
|
||||
+ "vg_name": "ceph-b78309b3-bd80-4399-87a3-ac647b216b63"
|
||||
+ },
|
||||
+ {
|
||||
+ "devices": [
|
||||
+ "/dev/sdb"
|
||||
+ ],
|
||||
+ "lv_name": "osd-block-477c303f-5eaf-4be8-b5cc-f6073eb345bf",
|
||||
+ "lv_uuid": "Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3",
|
||||
+ "tags":{
|
||||
+ "ceph.encrypted":"1"
|
||||
+ },
|
||||
+ "type": "block",
|
||||
+ "vg_name": "ceph-e3e0345b-8be1-40a7-955a-378ba967f954"
|
||||
+ }
|
||||
]
|
||||
}"""
|
||||
}
|
||||
@@ -51,7 +79,19 @@ CEPH_LVM_LIST = {
|
||||
'lv_uuid': 'Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn',
|
||||
'tags': {'ceph.encrypted': '1'},
|
||||
'type': 'block',
|
||||
- 'vg_name': 'ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc'}]
|
||||
+ 'vg_name': 'ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc'}],
|
||||
+ '8': [{'devices': ['/dev/nvme0n1'],
|
||||
+ 'lv_name': 'osd-db-b04857a0-a2a2-40c3-a490-cbe1f892a76c',
|
||||
+ 'lv_uuid': 'zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3',
|
||||
+ 'tags': {'ceph.encrypted': '1'},
|
||||
+ 'type': 'db',
|
||||
+ 'vg_name': 'ceph-b78309b3-bd80-4399-87a3-ac647b216b63'},
|
||||
+ {'devices': ['/dev/sdb'],
|
||||
+ 'lv_name': 'osd-block-477c303f-5eaf-4be8-b5cc-f6073eb345bf',
|
||||
+ 'lv_uuid': 'Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3',
|
||||
+ 'tags': {'ceph.encrypted': '1'},
|
||||
+ 'type': 'block',
|
||||
+ 'vg_name': 'ceph-e3e0345b-8be1-40a7-955a-378ba967f954'}]
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +100,7 @@ def test_select_osd_container(m_run):
|
||||
|
||||
m_run.return_value = CONT_PS_COMMAND_OUTPUT
|
||||
|
||||
- assert cephvolumescan.select_osd_container('docker') == "ceph-osd-0"
|
||||
+ assert cephvolumescan.select_osd_container('docker') == "ceph-bea1a933-0846-4aaa-8223-62cb8cb2873c-osd-8"
|
||||
|
||||
|
||||
@patch('leapp.libraries.actor.cephvolumescan.has_package')
|
||||
@@ -82,4 +122,8 @@ def test_encrypted_osds_list(m_get_ceph_lvm_list, m_isfile):
|
||||
m_get_ceph_lvm_list.return_value = CEPH_LVM_LIST
|
||||
m_isfile.return_value = True
|
||||
|
||||
- assert cephvolumescan.encrypted_osds_list() == ['Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn']
|
||||
+ assert cephvolumescan.encrypted_osds_list() == [
|
||||
+ 'Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn',
|
||||
+ 'zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3',
|
||||
+ 'Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3'
|
||||
+ ]
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
From bf1b5f5f537ff163470b29d8bb7ba452901368eb Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 22 Oct 2025 17:52:52 +0200
|
||||
Subject: [PATCH 29/55] Makefile: Do copy commands/ dir in containerized tests
|
||||
|
||||
In 7d9ae2c0 the commands dir copying was changed to copy the dir to
|
||||
tut/lib/$$_VENV/site-packages/leapp/cli/commands/ instead of the normal
|
||||
location in the container.
|
||||
|
||||
This fixed the problem that modifications on the host were not reflected
|
||||
in the testing containers. However a new problem was introduced -
|
||||
modifications to tests in the commands directory are not getting
|
||||
reflected in the testing containers.
|
||||
|
||||
This patch fixes that by copying the entire commands directory both to
|
||||
the normal location and the virtual env (path above).
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 9774a475..64115006 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,7 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' --exclude 'commands/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
$(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude '**/__pycache__/' /repo/commands/ /repocopy/tut/lib/$$_VENV/site-packages/leapp/cli/commands/ && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,70 +0,0 @@
|
||||
From 87f584d8f9b957b9ae0138d6963077d87ccb2067 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 20 Oct 2025 11:40:04 +0200
|
||||
Subject: [PATCH 30/55] skip pre-generation of systemd fstab mount units during
|
||||
LiveMode upgrade
|
||||
|
||||
The new storage initialization solution interfered with LiveMode. Since
|
||||
LiveMode is a different upgrade approach, we now skip pre-generation of
|
||||
systemd fstab mount units (mount_unit_generator actor) when
|
||||
upgrading this way.
|
||||
---
|
||||
.../actors/initramfs/mount_units_generator/actor.py | 5 ++++-
|
||||
.../libraries/mount_unit_generator.py | 8 ++++++--
|
||||
2 files changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
index 5fe25515..dd667513 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -1,16 +1,19 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
|
||||
|
||||
class MountUnitGenerator(Actor):
|
||||
"""
|
||||
Sets up storage initialization using systemd's mount units in the upgrade container.
|
||||
+
|
||||
+ Note that this storage initialization is skipped when the LiveMode is enabled.
|
||||
"""
|
||||
|
||||
name = 'mount_unit_generator'
|
||||
consumes = (
|
||||
+ LiveModeConfig,
|
||||
TargetUserSpaceInfo,
|
||||
)
|
||||
produces = (
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
index e1060559..943bddd4 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -5,7 +5,7 @@ import tempfile
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
|
||||
|
||||
def run_systemd_fstab_generator(output_directory):
|
||||
@@ -295,8 +295,12 @@ def request_units_inclusion_in_initramfs(files_to_include):
|
||||
|
||||
|
||||
def setup_storage_initialization():
|
||||
- userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
+ livemode_config = next(api.consume(LiveModeConfig), None)
|
||||
+ if livemode_config and livemode_config.is_enabled:
|
||||
+ api.current_logger().debug('Pre-generation of systemd fstab mount units skipped: The LiveMode is enabled.')
|
||||
+ return
|
||||
|
||||
+ userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
with mounting.NspawnActions(base_dir=userspace_info.path) as upgrade_container_ctx:
|
||||
with tempfile.TemporaryDirectory(dir='/var/lib/leapp/', prefix='tmp_systemd_fstab_') as workspace_path:
|
||||
run_systemd_fstab_generator(workspace_path)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
From 827e28de7b707f9fc458e1f5fdad9fffd7474abe Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Tue, 12 Aug 2025 16:59:01 +0200
|
||||
Subject: [PATCH 31/55] pylint: enable consider-using-set-comprehension
|
||||
|
||||
Fixed occurrences of list comprehensions wrapped in set() by using
|
||||
set comprehensions directly, removing disables for
|
||||
consider-using-set-comprehension added for Python 2 compatibility.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../checkconsumedassets/tests/test_asset_version_checking.py | 2 +-
|
||||
.../common/actors/selinux/selinuxapplycustom/actor.py | 4 +---
|
||||
3 files changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 5d75df40..e54d9a54 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -45,7 +45,6 @@ disable=
|
||||
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
# new for python3 version of pylint
|
||||
useless-object-inheritance,
|
||||
- consider-using-set-comprehension, # pylint3 force to use comprehension in place we don't want (py2 doesnt have these options, for inline skip)
|
||||
unnecessary-pass,
|
||||
invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
||||
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
diff --git a/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py b/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
index 9c324b44..f37dcea4 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
@@ -44,4 +44,4 @@ def test_make_report_entries_with_unique_urls():
|
||||
docs_url_to_title_map = {'/path/to/asset1': ['asset1_title1', 'asset1_title2'],
|
||||
'/path/to/asset2': ['asset2_title']}
|
||||
report_urls = check_consumed_assets_lib.make_report_entries_with_unique_urls(docs_url_to_title_map)
|
||||
- assert set([ru.value['url'] for ru in report_urls]) == {'/path/to/asset1', '/path/to/asset2'}
|
||||
+ assert {ru.value['url'] for ru in report_urls} == {'/path/to/asset1', '/path/to/asset2'}
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
index 4856f36a..db8fe8ac 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
@@ -40,9 +40,7 @@ class SELinuxApplyCustom(Actor):
|
||||
return
|
||||
|
||||
# get list of policy modules after the upgrade
|
||||
- installed_modules = set(
|
||||
- [module[0] for module in selinuxapplycustom.list_selinux_modules()]
|
||||
- )
|
||||
+ installed_modules = {module[0] for module in selinuxapplycustom.list_selinux_modules()}
|
||||
|
||||
# import custom SElinux modules
|
||||
for semodules in self.consume(SELinuxModules):
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,165 +0,0 @@
|
||||
From 006517ea2d69d3f0d9e3de2eb67bfb4d32f20551 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 10:46:10 +0200
|
||||
Subject: [PATCH 32/55] pylint: enable consider-using-with
|
||||
|
||||
Emitted when a resource-allocating assignment or call could be replaced
|
||||
by a 'with' block. Enabling this warning enforces using 'with' to ensure
|
||||
resources are properly released even if an exception occurs.
|
||||
|
||||
* ifcfgscanner: use StringIO in tests instead of mock_open for iteration support with 'with open'
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../ifcfgscanner/libraries/ifcfgscanner.py | 27 +++++++++----------
|
||||
.../tests/unit_test_ifcfgscanner.py | 8 +++---
|
||||
.../luksscanner/tests/test_luksdump_parser.py | 8 +++---
|
||||
.../scansaphana/tests/test_scansaphana.py | 6 ++---
|
||||
.../system_upgrade/common/libraries/guards.py | 2 +-
|
||||
6 files changed, 25 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index e54d9a54..fd770061 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -51,7 +51,6 @@ disable=
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
- consider-using-with, # on bunch spaces we cannot change that...
|
||||
duplicate-string-formatting-argument, # TMP: will be fixed in close future
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
use-dict-literal,
|
||||
diff --git a/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py b/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
index 683327b3..f0c8b847 100644
|
||||
--- a/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
@@ -18,23 +18,22 @@ def process_ifcfg(filename, secrets=False):
|
||||
return None
|
||||
|
||||
properties = []
|
||||
- for line in open(filename).readlines():
|
||||
- try:
|
||||
- (name, value) = line.split("#")[0].strip().split("=")
|
||||
+ with open(filename) as f:
|
||||
+ for line in f:
|
||||
+ try:
|
||||
+ (name, value) = line.split("#")[0].strip().split("=")
|
||||
+ except ValueError:
|
||||
+ # We're not interested in lines that are not
|
||||
+ # simple assignments. Play it safe.
|
||||
+ continue
|
||||
+
|
||||
if secrets:
|
||||
value = None
|
||||
- except ValueError:
|
||||
- # We're not interested in lines that are not
|
||||
- # simple assignments. Play it safe.
|
||||
- continue
|
||||
-
|
||||
- # Deal with simple quoting. We don't expand anything, nor do
|
||||
- # multiline strings or anything of that sort.
|
||||
- if value is not None and len(value) > 1 and value[0] == value[-1]:
|
||||
- if value.startswith('"') or value.startswith("'"):
|
||||
+ elif len(value) > 1 and value[0] in ('"', "'") and value[0] == value[-1]:
|
||||
+ # Deal with simple quoting. We don't expand anything, nor do
|
||||
+ # multiline strings or anything of that sort.
|
||||
value = value[1:-1]
|
||||
-
|
||||
- properties.append(IfCfgProperty(name=name, value=value))
|
||||
+ properties.append(IfCfgProperty(name=name, value=value))
|
||||
return properties
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py b/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
index d3b4846f..d996de84 100644
|
||||
--- a/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
@@ -1,5 +1,6 @@
|
||||
import errno
|
||||
import textwrap
|
||||
+from io import StringIO
|
||||
from os.path import basename
|
||||
|
||||
import mock
|
||||
@@ -63,8 +64,7 @@ def test_ifcfg1(monkeypatch):
|
||||
KEY_TYPE=key
|
||||
""")
|
||||
|
||||
- mock_config = mock.mock_open(read_data=ifcfg_file)
|
||||
- with mock.patch(_builtins_open, mock_config):
|
||||
+ with mock.patch(_builtins_open, return_value=StringIO(ifcfg_file)):
|
||||
monkeypatch.setattr(ifcfgscanner, "listdir", _listdir_ifcfg)
|
||||
monkeypatch.setattr(ifcfgscanner.path, "exists", _exists_ifcfg)
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
@@ -110,8 +110,8 @@ def test_ifcfg_key(monkeypatch):
|
||||
Report ifcfg secrets from keys- file.
|
||||
"""
|
||||
|
||||
- mock_config = mock.mock_open(read_data="KEY_PASSPHRASE1=Hell0")
|
||||
- with mock.patch(_builtins_open, mock_config):
|
||||
+ file_data = "KEY_PASSPHRASE1=Hell0"
|
||||
+ with mock.patch(_builtins_open, side_effect=lambda *a, **k: StringIO(file_data)):
|
||||
monkeypatch.setattr(ifcfgscanner, "listdir", _listdir_ifcfg)
|
||||
monkeypatch.setattr(ifcfgscanner.path, "exists", _exists_keys)
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py b/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
index 4b190149..f0482eef 100644
|
||||
--- a/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
+++ b/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
@@ -7,8 +7,8 @@ CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def test_luksdump_parser_luks1(current_actor_context):
|
||||
- f = open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks1.txt'))
|
||||
- parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
+ with open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks1.txt')) as f:
|
||||
+ parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
|
||||
assert parsed_dict["Version"] == "1"
|
||||
assert parsed_dict["Cipher name"] == "aes"
|
||||
@@ -39,8 +39,8 @@ def test_luksdump_parser_luks1(current_actor_context):
|
||||
|
||||
|
||||
def test_luksdump_parser_luks2_tokens(current_actor_context):
|
||||
- f = open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks2_tokens.txt'))
|
||||
- parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
+ with open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks2_tokens.txt')) as f:
|
||||
+ parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
|
||||
assert parsed_dict["Version"] == "2"
|
||||
assert parsed_dict["Epoch"] == "9"
|
||||
diff --git a/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py b/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
index 0b55c9fb..38a1cae7 100644
|
||||
--- a/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
+++ b/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
@@ -77,9 +77,9 @@ class SubprocessCall(object):
|
||||
assert args[0][0:3] == ['sudo', '-u', self.admusername]
|
||||
cmd = args[0][3:]
|
||||
kwargs.pop('checked', None)
|
||||
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
- p.wait()
|
||||
- return {'exit_code': p.returncode, 'stdout': p.stdout.read()}
|
||||
+ with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
|
||||
+ stdout, stderr = p.communicate()
|
||||
+ return {'exit_code': p.returncode, 'stdout': stdout.decode('utf-8'), 'stderr': stderr.decode('utf-8')}
|
||||
|
||||
|
||||
def test_scansaphana_get_instance_status(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/libraries/guards.py b/repos/system_upgrade/common/libraries/guards.py
|
||||
index c8001817..ea2bf4dd 100644
|
||||
--- a/repos/system_upgrade/common/libraries/guards.py
|
||||
+++ b/repos/system_upgrade/common/libraries/guards.py
|
||||
@@ -34,7 +34,7 @@ def guarded_execution(*guards):
|
||||
def connection_guard(url='https://example.com'):
|
||||
def closure():
|
||||
try:
|
||||
- urlopen(url)
|
||||
+ urlopen(url) # pylint: disable=consider-using-with
|
||||
return None
|
||||
except URLError as e:
|
||||
cause = '''Failed to open url '{url}' with error: {error}'''.format(url=url, error=e)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
From 21bf23c218966040d4c3104d04ce0bcc39d0fb3d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 11:36:36 +0200
|
||||
Subject: [PATCH 33/55] pylint: duplicate-string-formatting-argument
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
repos/system_upgrade/common/libraries/fetch.py | 4 ++--
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index fd770061..aaa5d99e 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -51,7 +51,6 @@ disable=
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
- duplicate-string-formatting-argument, # TMP: will be fixed in close future
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
use-dict-literal,
|
||||
redundant-u-string-prefix, # still have py2 to support
|
||||
diff --git a/repos/system_upgrade/common/libraries/fetch.py b/repos/system_upgrade/common/libraries/fetch.py
|
||||
index 82bf4ff3..baf2c4eb 100644
|
||||
--- a/repos/system_upgrade/common/libraries/fetch.py
|
||||
+++ b/repos/system_upgrade/common/libraries/fetch.py
|
||||
@@ -56,8 +56,8 @@ def _request_data(service_path, cert, proxies, timeout=REQUEST_TIMEOUT):
|
||||
timeout = (timeout[0], timeout[1] + 10)
|
||||
if attempt > MAX_ATTEMPTS:
|
||||
logger.warning(
|
||||
- 'Attempt {} of {} to get {} failed: {}.'
|
||||
- .format(MAX_ATTEMPTS, MAX_ATTEMPTS, service_path, etype_msg)
|
||||
+ 'Attempt {max} of {max} to get {service} failed: {error}.'
|
||||
+ .format(max=MAX_ATTEMPTS, service=service_path, error=etype_msg)
|
||||
)
|
||||
raise
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 9cd95f0fb90a60b650ddc5bd05df6807f0e80a60 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:13:24 +0200
|
||||
Subject: [PATCH 34/55] pylint: enable use-dict-literal
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index aaa5d99e..bc051513 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,7 +52,6 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- use-dict-literal,
|
||||
redundant-u-string-prefix, # still have py2 to support
|
||||
logging-format-interpolation,
|
||||
logging-not-lazy,
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
From d99c059cb0eae4d720a2d48fb39acf6e93bc0b0e Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:19:58 +0200
|
||||
Subject: [PATCH 35/55] pylint: enable redundant-u-string-prefix
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../common/actors/rootscanner/tests/test_rootscanner.py | 6 +++---
|
||||
2 files changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index bc051513..7d938715 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,7 +52,6 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- redundant-u-string-prefix, # still have py2 to support
|
||||
logging-format-interpolation,
|
||||
logging-not-lazy,
|
||||
use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
diff --git a/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py b/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
index 659a3017..07ce5da8 100644
|
||||
--- a/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
@@ -9,9 +9,9 @@ from leapp.libraries.actor.rootscanner import scan_dir
|
||||
|
||||
|
||||
@pytest.mark.parametrize("filename,symlink,count_invalid",
|
||||
- [(u'a_utf_file'.encode('utf-8'), u"utf8_symlink".encode('utf-8'), 0),
|
||||
- (u'простофайл'.encode('koi8-r'), u"этонеутф8".encode('koi8-r'), 2),
|
||||
- (u'a_utf_file'.encode('utf-8'), u"этонеутф8".encode('koi8-r'), 1)])
|
||||
+ [('a_utf_file'.encode('utf-8'), "utf8_symlink".encode('utf-8'), 0),
|
||||
+ ('простофайл'.encode('koi8-r'), "этонеутф8".encode('koi8-r'), 2),
|
||||
+ ('a_utf_file'.encode('utf-8'), "этонеутф8".encode('koi8-r'), 1)])
|
||||
def test_invalid_symlinks(filename, symlink, count_invalid):
|
||||
# Let's create a directory with both valid utf-8 and non-utf symlinks
|
||||
# NOTE(ivasilev) As this has to run for python2 as well can't use the nice tempfile.TemporaryDirectory way
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,110 +0,0 @@
|
||||
From 078ba51a5851e388abe1357a552b981cba1acca9 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:43:04 +0200
|
||||
Subject: [PATCH 36/55] pylint: enable logging-not-lazy
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../rpmtransactionconfigtaskscollector.py | 5 +++--
|
||||
.../storagescanner/libraries/storagescanner.py | 8 ++++++--
|
||||
.../common/libraries/persistentnetnames.py | 2 +-
|
||||
.../libraries/multipathconfread.py | 14 +++++++++-----
|
||||
5 files changed, 19 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 7d938715..f7f4b25d 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -53,7 +53,6 @@ disable=
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
logging-format-interpolation,
|
||||
- logging-not-lazy,
|
||||
use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
|
||||
[FORMAT]
|
||||
diff --git a/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py b/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
index 43ac1fc4..84895f83 100644
|
||||
--- a/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
+++ b/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
@@ -29,8 +29,9 @@ def load_tasks(base_dir, logger):
|
||||
filtered = set(to_install) - set(to_install_filtered)
|
||||
if filtered:
|
||||
api.current_logger().debug(
|
||||
- 'The following packages from "to_install" file will be ignored as they are already installed:'
|
||||
- '\n- ' + '\n- '.join(filtered))
|
||||
+ 'The following packages from "to_install" file will be ignored as they are already installed:\n- %s',
|
||||
+ '\n- '.join(filtered)
|
||||
+ )
|
||||
|
||||
return RpmTransactionTasks(
|
||||
to_install=to_install_filtered,
|
||||
diff --git a/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py b/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
index cae38731..e2d869da 100644
|
||||
--- a/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
@@ -35,7 +35,7 @@ def _is_file_readable(path):
|
||||
def _get_cmd_output(cmd, delim, expected_len):
|
||||
""" Verify if command exists and return output """
|
||||
if not any(os.access(os.path.join(path, cmd[0]), os.X_OK) for path in os.environ['PATH'].split(os.pathsep)):
|
||||
- api.current_logger().warning("'%s': command not found" % cmd[0])
|
||||
+ api.current_logger().warning("'%s': command not found", cmd[0])
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -45,7 +45,11 @@ def _get_cmd_output(cmd, delim, expected_len):
|
||||
output = subprocess.check_output(cmd, env={'LVM_SUPPRESS_FD_WARNINGS': '1', 'PATH': os.environ['PATH']})
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
- api.current_logger().debug("Command '%s' return non-zero exit status: %s" % (" ".join(cmd), e.returncode))
|
||||
+ api.current_logger().debug(
|
||||
+ "Command '%s' returned non-zero exit status: %s",
|
||||
+ " ".join(cmd),
|
||||
+ e.returncode
|
||||
+ )
|
||||
return
|
||||
|
||||
if bytes is not str:
|
||||
diff --git a/repos/system_upgrade/common/libraries/persistentnetnames.py b/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
index 8769712c..7fdf7eaa 100644
|
||||
--- a/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
+++ b/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
@@ -50,7 +50,7 @@ def interfaces():
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
# FIXME(msekleta): We should probably handle errors more granularly
|
||||
# Maybe we should inhibit upgrade process at this point
|
||||
- api.current_logger().warning('Failed to gather information about network interface: ' + str(e))
|
||||
+ api.current_logger().warning('Failed to gather information about network interface: %s', e)
|
||||
continue
|
||||
|
||||
yield Interface(**attrs)
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py b/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
index e5b3f06c..5b1cef50 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
@@ -68,12 +68,16 @@ def _parse_config_dir(config_dir):
|
||||
res.append(conf)
|
||||
except OSError as e:
|
||||
if e.errno == errno.ENOENT:
|
||||
- api.current_logger().debug('Multipath conf directory ' +
|
||||
- '"{}" doesn\'t exist'.format(config_dir))
|
||||
+ api.current_logger().debug(
|
||||
+ 'Multipath conf directory "%s" doesn\'t exist',
|
||||
+ config_dir
|
||||
+ )
|
||||
else:
|
||||
- api.current_logger().warning('Failed to read multipath config ' +
|
||||
- 'directory ' +
|
||||
- '"{}": {}'.format(config_dir, e))
|
||||
+ api.current_logger().warning(
|
||||
+ 'Failed to read multipath config directory "%s": %s',
|
||||
+ config_dir,
|
||||
+ e
|
||||
+ )
|
||||
return res
|
||||
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
From 1104e25977b728a7059fc1ef4613ef55d1e0a9d7 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:51:34 +0200
|
||||
Subject: [PATCH 37/55] pylint: enable use-yield-from
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 3 +--
|
||||
.../mount_units_generator/tests/test_mount_unit_generation.py | 3 +--
|
||||
.../actors/storagescanner/tests/unit_test_storagescanner.py | 3 +--
|
||||
.../tests/unit_test_targetuserspacecreator.py | 3 +--
|
||||
repos/system_upgrade/common/libraries/config/version.py | 3 +--
|
||||
5 files changed, 5 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index f7f4b25d..15a69461 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,8 +52,7 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- logging-format-interpolation,
|
||||
- use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
+ logging-format-interpolation
|
||||
|
||||
[FORMAT]
|
||||
# Maximum number of characters on a single line.
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index b814f6ce..9d75a31d 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -196,8 +196,7 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
('/source/dir', ['local-fs.target.requires'], ['unit1.mount', 'unit2.mount']),
|
||||
('/source/dir/local-fs.target.requires', [], ['unit1.mount', 'unit2.mount']),
|
||||
]
|
||||
- for i in tuples_to_yield:
|
||||
- yield i
|
||||
+ yield from tuples_to_yield
|
||||
|
||||
def mock_isdir(path):
|
||||
return 'local-fs.target.requires' in path
|
||||
diff --git a/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py b/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
index 456e40ec..3c7fcbd6 100644
|
||||
--- a/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
@@ -268,8 +268,7 @@ def test_get_lsblk_info(monkeypatch):
|
||||
'crypt', '', '/dev/nvme0n1p1'],
|
||||
['/dev/nvme0n1p1', '259:1', '0', str(39 * bytes_per_gb), '0', 'part', '', '/dev/nvme0n1'],
|
||||
]
|
||||
- for output_line_parts in output_lines_split_on_whitespace:
|
||||
- yield output_line_parts
|
||||
+ yield from output_lines_split_on_whitespace
|
||||
elif len(cmd) == 5 and cmd[:4] == ['lsblk', '-nr', '--output', 'NAME,KNAME,SIZE']:
|
||||
# We cannot have the output in a list, since the command is called per device. Therefore, we have to map
|
||||
# each device path to its output.
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 2ae194d7..e78c3ac7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -95,8 +95,7 @@ def traverse_structure(structure, root=Path('/')):
|
||||
filepath = root / filename
|
||||
|
||||
if isinstance(links_to, dict):
|
||||
- for pair in traverse_structure(links_to, filepath):
|
||||
- yield pair
|
||||
+ yield from traverse_structure(links_to, root=filepath)
|
||||
else:
|
||||
yield (filepath, links_to)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/version.py b/repos/system_upgrade/common/libraries/config/version.py
|
||||
index 00ce3ec8..5efa932d 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/version.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/version.py
|
||||
@@ -106,8 +106,7 @@ class _SupportedVersionsDict(dict):
|
||||
|
||||
def __iter__(self):
|
||||
self._feed_supported_versions()
|
||||
- for d in self.data:
|
||||
- yield d
|
||||
+ yield from self.data
|
||||
|
||||
def __repr__(self):
|
||||
self._feed_supported_versions()
|
||||
--
|
||||
2.51.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,127 +0,0 @@
|
||||
From e530472760f0df186531bf3d17323ee082c7fba8 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 13:12:24 +0200
|
||||
Subject: [PATCH 39/55] pylint: enable invalid-envvar-default
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../removeresumeservice/tests/test_removeresumeservice.py | 2 +-
|
||||
.../tests/test_scheduleselinuxrelabeling.py | 4 ++--
|
||||
.../tests/component_test_selinuxapplycustom.py | 2 +-
|
||||
.../tests/component_test_selinuxcontentscanner.py | 2 +-
|
||||
.../selinuxprepare/tests/component_test_selinuxprepare.py | 2 +-
|
||||
.../setpermissiveselinux/tests/test_setpermissiveselinux.py | 4 ++--
|
||||
7 files changed, 8 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index d98ab151..7a373e3d 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -45,7 +45,6 @@ disable=
|
||||
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
||||
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
diff --git a/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py b/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
index ea803856..d59ef346 100644
|
||||
--- a/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
+++ b/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
@@ -11,7 +11,7 @@ import pytest
|
||||
'under the root user.',
|
||||
)
|
||||
# TODO make the test not destructive
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_remove_resume_service(current_actor_context):
|
||||
service_name = 'leapp_resume.service'
|
||||
diff --git a/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py b/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
index 595b9985..8603bd97 100644
|
||||
--- a/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
+++ b/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
@@ -9,7 +9,7 @@ from leapp.snactor.fixture import current_actor_context
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system',
|
||||
)
|
||||
def test_schedule_no_relabel(current_actor_context):
|
||||
@@ -19,7 +19,7 @@ def test_schedule_no_relabel(current_actor_context):
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system',
|
||||
)
|
||||
def test_schedule_relabel(current_actor_context):
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
index 8a4665c1..aab18e58 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
@@ -72,7 +72,7 @@ def destructive_selinux_env():
|
||||
"Failed to remove SELinux customizations after testing")
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxApplyCustom(current_actor_context, destructive_selinux_teardown):
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
index faa2e1b0..802e038a 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
@@ -76,7 +76,7 @@ def find_semanage_rule(rules, rule):
|
||||
return next((r for r in rules if all(word in r for word in rule)), None)
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "false") in ["False", "false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxContentScanner(current_actor_context, destructive_selinux_env):
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
index bad1baa2..d124675a 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
@@ -76,7 +76,7 @@ def destructive_selinux_env():
|
||||
_run_cmd(semodule_command)
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv('DESTRUCTIVE_TESTING', False) in [False, '0'],
|
||||
+@pytest.mark.skipif(os.getenv('DESTRUCTIVE_TESTING', '0').lower() in ['false', '0'],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxPrepare(current_actor_context, semodule_lfull_initial, semanage_export_initial,
|
||||
destructive_selinux_env):
|
||||
diff --git a/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py b/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
index efa4e550..9acdf39a 100644
|
||||
--- a/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
+++ b/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
@@ -6,7 +6,7 @@ from leapp.models import SelinuxPermissiveDecision
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["0", "false"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def check_permissive_in_conf():
|
||||
""" Check if we have set permissive in SElinux conf file """
|
||||
@@ -19,7 +19,7 @@ def check_permissive_in_conf():
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "false").lower() in ["0", "false"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_set_selinux_permissive(current_actor_context):
|
||||
current_actor_context.feed(SelinuxPermissiveDecision(set_permissive=True))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,613 +0,0 @@
|
||||
From 81b24a657037ceffc3959abb4231a19352ca9a82 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 14:42:15 +0200
|
||||
Subject: [PATCH 40/55] pylint: enable bad-option-value
|
||||
|
||||
This pylint warning triggers when you try to disable a pylint check that is unknown or obsolete. Enabling this rule caused such warnings to appear, so the corresponding disables needed to be removed:
|
||||
* no-absolute-import -> Only relevant for Python 2. Python 3 uses absolute imports by default.
|
||||
* no-init -> Obsolete: __init__ method checks have changed, this option no longer exists.
|
||||
* bad-continuation -> Superseded by modern pylint formatting checks.
|
||||
* no-self-use -> Checks whether a method could be a function.
|
||||
* relative-import -> Python 3 discourages relative imports differently.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 8 +----
|
||||
commands/upgrade/breadcrumbs.py | 9 +++--
|
||||
.../checkmemory/libraries/checkmemory.py | 4 +--
|
||||
.../tests/test_enablerhsmtargetrepos.py | 3 +-
|
||||
.../tests/test_mount_unit_generation.py | 3 +-
|
||||
.../libraries/upgradeinitramfsgenerator.py | 2 +-
|
||||
.../unit_test_upgradeinitramfsgenerator.py | 2 +-
|
||||
.../tests/test_kernelcmdlineconfig.py | 4 +--
|
||||
.../opensshpermitrootlogincheck/actor.py | 6 ++--
|
||||
.../actors/persistentnetnamesdisable/actor.py | 6 ++--
|
||||
.../libraries/scankernel.py | 2 +-
|
||||
.../tests/unit_test_targetuserspacecreator.py | 3 +-
|
||||
.../tests/test_trustedgpgkeys.py | 2 +-
|
||||
.../common/files/rhel_upgrade.py | 9 +++--
|
||||
.../common/libraries/dnfplugin.py | 3 +-
|
||||
repos/system_upgrade/common/libraries/grub.py | 4 +--
|
||||
.../common/libraries/mounting.py | 3 +-
|
||||
.../common/libraries/overlaygen.py | 35 ++++++++++++-------
|
||||
.../common/libraries/tests/test_distro.py | 3 +-
|
||||
.../common/libraries/tests/test_grub.py | 2 +-
|
||||
.../common/libraries/tests/test_rhsm.py | 6 ++--
|
||||
.../common/libraries/testutils.py | 2 +-
|
||||
.../checkvdo/tests/unit_test_checkvdo.py | 6 ++--
|
||||
.../actors/nisscanner/libraries/nisscan.py | 6 ++--
|
||||
.../libraries/opensslconfigcheck.py | 3 +-
|
||||
25 files changed, 81 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 7a373e3d..0cba1129 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -9,23 +9,19 @@ disable=
|
||||
raising-bad-type,
|
||||
redundant-keyword-arg, # it's one or the other, this one is not so bad at all
|
||||
# "W" Warnings for stylistic problems or minor programming issues
|
||||
- no-absolute-import,
|
||||
arguments-differ,
|
||||
cell-var-from-loop,
|
||||
fixme,
|
||||
lost-exception,
|
||||
- no-init,
|
||||
pointless-string-statement,
|
||||
protected-access,
|
||||
redefined-outer-name,
|
||||
- relative-import,
|
||||
undefined-loop-variable,
|
||||
unsubscriptable-object,
|
||||
unused-argument,
|
||||
unused-import,
|
||||
unspecified-encoding,
|
||||
# "C" Coding convention violations
|
||||
- bad-continuation,
|
||||
missing-docstring,
|
||||
wrong-import-order,
|
||||
use-maxsplit-arg,
|
||||
@@ -33,7 +29,6 @@ disable=
|
||||
consider-using-enumerate,
|
||||
# "R" Refactor recommendations
|
||||
duplicate-code,
|
||||
- no-self-use,
|
||||
too-few-public-methods,
|
||||
too-many-branches,
|
||||
too-many-locals,
|
||||
@@ -42,10 +37,9 @@ disable=
|
||||
use-list-literal,
|
||||
use-dict-literal,
|
||||
too-many-lines, # we do not want to take care about that one
|
||||
- too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
+ too-many-positional-arguments,
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
diff --git a/commands/upgrade/breadcrumbs.py b/commands/upgrade/breadcrumbs.py
|
||||
index 1a90c143..95a551c3 100644
|
||||
--- a/commands/upgrade/breadcrumbs.py
|
||||
+++ b/commands/upgrade/breadcrumbs.py
|
||||
@@ -80,7 +80,8 @@ class _BreadCrumbs:
|
||||
# even though it shouldn't though, just ignore it
|
||||
pass
|
||||
|
||||
- def _commit_rhsm_facts(self):
|
||||
+ @staticmethod
|
||||
+ def _commit_rhsm_facts():
|
||||
if runs_in_container():
|
||||
return
|
||||
cmd = ['/usr/sbin/subscription-manager', 'facts', '--update']
|
||||
@@ -122,7 +123,8 @@ class _BreadCrumbs:
|
||||
except OSError:
|
||||
sys.stderr.write('WARNING: Could not write to /etc/migration-results\n')
|
||||
|
||||
- def _get_packages(self):
|
||||
+ @staticmethod
|
||||
+ def _get_packages():
|
||||
cmd = ['/bin/bash', '-c', 'rpm -qa --queryformat="%{nevra} %{SIGPGP:pgpsig}\n" | grep -Ee "leapp|snactor"']
|
||||
res = _call(cmd, lambda x, y: None, lambda x, y: None)
|
||||
if res.get('exit_code', None) == 0:
|
||||
@@ -131,7 +133,8 @@ class _BreadCrumbs:
|
||||
for t in [line.strip().split(' ', 1) for line in res['stdout'].split('\n') if line.strip()]]
|
||||
return []
|
||||
|
||||
- def _verify_leapp_pkgs(self):
|
||||
+ @staticmethod
|
||||
+ def _verify_leapp_pkgs():
|
||||
if not os.environ.get('LEAPP_IPU_IN_PROGRESS'):
|
||||
return []
|
||||
upg_path = os.environ.get('LEAPP_IPU_IN_PROGRESS').split('to')
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
index 808c9662..040b404b 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
@@ -34,8 +34,8 @@ def process():
|
||||
if minimum_req_error:
|
||||
title = 'Minimum memory requirements for RHEL {} are not met'.format(version.get_target_major_version())
|
||||
summary = 'Memory detected: {} MiB, required: {} MiB'.format(
|
||||
- int(minimum_req_error['detected'] / 1024), # noqa: W1619; pylint: disable=old-division
|
||||
- int(minimum_req_error['minimal_req'] / 1024), # noqa: W1619; pylint: disable=old-division
|
||||
+ int(minimum_req_error['detected'] / 1024),
|
||||
+ int(minimum_req_error['minimal_req'] / 1024),
|
||||
)
|
||||
reporting.create_report([
|
||||
reporting.Title(title),
|
||||
diff --git a/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py b/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
index f7b3f34a..dba38fff 100644
|
||||
--- a/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
@@ -17,7 +17,8 @@ def not_isolated_actions(raise_err=False):
|
||||
def __init__(self, base_dir=None):
|
||||
pass
|
||||
|
||||
- def call(self, cmd, **kwargs):
|
||||
+ @staticmethod
|
||||
+ def call(cmd, **kwargs):
|
||||
commands_called.append((cmd, kwargs))
|
||||
if raise_err:
|
||||
raise_call_error()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index 9d75a31d..8849ada9 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -249,7 +249,8 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
def __init__(self):
|
||||
self.base_dir = '/container'
|
||||
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return os.path.join('/container', path.lstrip('/'))
|
||||
|
||||
mock_container = MockedContainerContext()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
index 3ad92167..f7e4a8af 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
@@ -271,7 +271,7 @@ def _get_fspace(path, convert_to_mibs=False, coefficient=1):
|
||||
coefficient = min(coefficient, 1)
|
||||
fspace_bytes = int(stat.f_frsize * stat.f_bavail * coefficient)
|
||||
if convert_to_mibs:
|
||||
- return int(fspace_bytes / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(fspace_bytes / 1024 / 1024)
|
||||
return fspace_bytes
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
index 185cd4f0..b96bf79f 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
@@ -257,7 +257,7 @@ class MockedGetFspace:
|
||||
def __call__(self, dummy_path, convert_to_mibs=False):
|
||||
if not convert_to_mibs:
|
||||
return self.space
|
||||
- return int(self.space / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(self.space / 1024 / 1024)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('input_msgs,dracut_modules,kernel_modules', [
|
||||
diff --git a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
index b7e51833..5b35bcd3 100644
|
||||
--- a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
@@ -15,7 +15,7 @@ from leapp.models import InstalledTargetKernelInfo, KernelCmdlineArg, TargetKern
|
||||
|
||||
TARGET_KERNEL_NEVRA = 'kernel-core-1.2.3-4.x86_64.el8.x64_64'
|
||||
|
||||
-# pylint: disable=E501
|
||||
+# pylint: disable=line-too-long
|
||||
SAMPLE_KERNEL_ARGS = ('ro rootflags=subvol=root'
|
||||
' resume=/dev/mapper/luks-2c0df999-81ec-4a35-a1f9-b93afee8c6ad'
|
||||
' rd.luks.uuid=luks-90a6412f-c588-46ca-9118-5aca35943d25'
|
||||
@@ -31,7 +31,7 @@ title="Fedora Linux (6.5.13-100.fc37.x86_64) 37 (Thirty Seven)"
|
||||
id="a3018267cdd8451db7c77bb3e5b1403d-6.5.13-100.fc37.x86_64"
|
||||
""" # noqa: E501
|
||||
SAMPLE_GRUBBY_INFO_OUTPUT = TEMPLATE_GRUBBY_INFO_OUTPUT.format(SAMPLE_KERNEL_ARGS, SAMPLE_KERNEL_ROOT)
|
||||
-# pylint: enable=E501
|
||||
+# pylint: enable=line-too-long
|
||||
|
||||
|
||||
class MockedRun:
|
||||
diff --git a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
index 9c1a421c..98d329ab 100644
|
||||
--- a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
@@ -55,7 +55,8 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
else:
|
||||
api.current_logger().warning('Unknown source major version: {}'.format(get_source_major_version()))
|
||||
|
||||
- def process7to8(self, config):
|
||||
+ @staticmethod
|
||||
+ def process7to8(config):
|
||||
# when the config was not modified, we can pass this check and let the
|
||||
# rpm handle the configuration file update
|
||||
if not config.modified:
|
||||
@@ -112,7 +113,8 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
] + COMMON_RESOURCES)
|
||||
|
||||
- def process8to9(self, config):
|
||||
+ @staticmethod
|
||||
+ def process8to9(config):
|
||||
# RHEL8 default sshd configuration file is not modified: It will get replaced by rpm and
|
||||
# root will no longer be able to connect through ssh. This will probably result in many
|
||||
# false positives so it will have to be waived a lot
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
index 1add3588..b0182982 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
@@ -18,7 +18,8 @@ class PersistentNetNamesDisable(Actor):
|
||||
produces = (KernelCmdlineArg, Report)
|
||||
tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
|
||||
- def ethX_count(self, interfaces):
|
||||
+ @staticmethod
|
||||
+ def ethX_count(interfaces):
|
||||
ethX = re.compile('eth[0-9]+')
|
||||
count = 0
|
||||
|
||||
@@ -27,7 +28,8 @@ class PersistentNetNamesDisable(Actor):
|
||||
count = count + 1
|
||||
return count
|
||||
|
||||
- def single_eth0(self, interfaces):
|
||||
+ @staticmethod
|
||||
+ def single_eth0(interfaces):
|
||||
return len(interfaces) == 1 and interfaces[0].name == 'eth0'
|
||||
|
||||
def disable_persistent_naming(self):
|
||||
diff --git a/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py b/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
index c1cc69ee..35683cca 100644
|
||||
--- a/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
+++ b/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
@@ -70,7 +70,7 @@ def get_boot_files_provided_by_kernel_pkg(kernel_nevra):
|
||||
|
||||
@suppress_deprecation(InstalledTargetKernelVersion)
|
||||
def process():
|
||||
- # pylint: disable=no-else-return - false positive
|
||||
+ # pylint: disable=no-else-return # false positive
|
||||
# TODO: should we take care about stuff of kernel-rt and kernel in the same
|
||||
# time when both are present? or just one? currently, handle only one
|
||||
# of these during the upgrade. kernel-rt has higher prio when original sys
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 1e5b87b0..bb17d89a 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -50,7 +50,8 @@ class MockedMountingBase:
|
||||
def __call__(self, **dummy_kwarg):
|
||||
yield self
|
||||
|
||||
- def call(self, *args, **kwargs):
|
||||
+ @staticmethod
|
||||
+ def call(*args, **kwargs):
|
||||
return {'stdout': ''}
|
||||
|
||||
def nspawn(self):
|
||||
diff --git a/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py b/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
index 7497c2a9..b8229d00 100644
|
||||
--- a/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
+++ b/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
@@ -40,7 +40,7 @@ class MockedGetGpgFromFile:
|
||||
self._data[fname] = fps
|
||||
|
||||
def get_files(self):
|
||||
- return self._data.keys() # noqa: W1655; pylint: disable=dict-keys-not-iterating
|
||||
+ return self._data.keys()
|
||||
|
||||
def __call__(self, fname):
|
||||
return self._data.get(fname, [])
|
||||
diff --git a/repos/system_upgrade/common/files/rhel_upgrade.py b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
index 4f76a61d..a5d7045b 100644
|
||||
--- a/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
+++ b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
@@ -49,7 +49,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
metavar="[%s]" % "|".join(CMDS))
|
||||
parser.add_argument('filename')
|
||||
|
||||
- def _process_entities(self, entities, op, entity_name):
|
||||
+ @staticmethod
|
||||
+ def _process_entities(entities, op, entity_name):
|
||||
"""
|
||||
Adds list of packages for given operation to the transaction
|
||||
"""
|
||||
@@ -73,7 +74,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
with open(self.opts.filename, 'w+') as fo:
|
||||
json.dump(self.plugin_data, fo, sort_keys=True, indent=2)
|
||||
|
||||
- def _read_aws_region(self, repo):
|
||||
+ @staticmethod
|
||||
+ def _read_aws_region(repo):
|
||||
region = None
|
||||
if repo.baseurl:
|
||||
# baseurl is tuple (changed by Amazon-id plugin)
|
||||
@@ -86,7 +88,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
sys.exit(1)
|
||||
return region
|
||||
|
||||
- def _fix_rhui_url(self, repo, region):
|
||||
+ @staticmethod
|
||||
+ def _fix_rhui_url(repo, region):
|
||||
if repo.baseurl:
|
||||
repo.baseurl = tuple(
|
||||
url.replace('REGION', region, 1) for url in repo.baseurl
|
||||
diff --git a/repos/system_upgrade/common/libraries/dnfplugin.py b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
index 4f0c3a99..1af52dc5 100644
|
||||
--- a/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
+++ b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
@@ -461,9 +461,10 @@ def perform_transaction_install(target_userspace_info, storage_info, used_repos,
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _prepare_perform(used_repos, target_userspace_info, xfs_info, storage_info, target_iso=None):
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
+ # noqa: W0135
|
||||
reserve_space = overlaygen.get_recommended_leapp_free_space(target_userspace_info.path)
|
||||
with _prepare_transaction(used_repos=used_repos,
|
||||
target_userspace_info=target_userspace_info
|
||||
diff --git a/repos/system_upgrade/common/libraries/grub.py b/repos/system_upgrade/common/libraries/grub.py
|
||||
index 71432371..77679d01 100644
|
||||
--- a/repos/system_upgrade/common/libraries/grub.py
|
||||
+++ b/repos/system_upgrade/common/libraries/grub.py
|
||||
@@ -34,7 +34,6 @@ class EFIBootLoaderEntry:
|
||||
"""
|
||||
Representation of an UEFI boot loader entry.
|
||||
"""
|
||||
- # pylint: disable=eq-without-hash
|
||||
|
||||
def __init__(self, boot_number, label, active, efi_bin_source):
|
||||
self.boot_number = boot_number
|
||||
@@ -163,7 +162,8 @@ class EFIBootInfo:
|
||||
# it's not expected that no entry exists
|
||||
raise StopActorExecution('UEFI: Unable to detect any UEFI bootloader entry.')
|
||||
|
||||
- def _parse_key_value(self, bootmgr_output, key):
|
||||
+ @staticmethod
|
||||
+ def _parse_key_value(bootmgr_output, key):
|
||||
# e.g.: <key>: <value>
|
||||
for line in bootmgr_output.splitlines():
|
||||
if line.startswith(key + ':'):
|
||||
diff --git a/repos/system_upgrade/common/libraries/mounting.py b/repos/system_upgrade/common/libraries/mounting.py
|
||||
index 4e99e31e..ae3885cf 100644
|
||||
--- a/repos/system_upgrade/common/libraries/mounting.py
|
||||
+++ b/repos/system_upgrade/common/libraries/mounting.py
|
||||
@@ -66,7 +66,8 @@ class IsolationType:
|
||||
""" Release the isolation context """
|
||||
pass
|
||||
|
||||
- def make_command(self, cmd):
|
||||
+ @staticmethod
|
||||
+ def make_command(cmd):
|
||||
""" Transform the given command to the isolated environment """
|
||||
return cmd
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index a048af2b..83dc33b8 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -185,7 +185,7 @@ def _get_fspace(path, convert_to_mibs=False, coefficient=1):
|
||||
coefficient = min(coefficient, 1)
|
||||
fspace_bytes = int(stat.f_frsize * stat.f_bavail * coefficient)
|
||||
if convert_to_mibs:
|
||||
- return int(fspace_bytes / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(fspace_bytes / 1024 / 1024)
|
||||
return fspace_bytes
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ def _prepare_required_mounts(scratch_dir, mounts_dir, storage_info, scratch_rese
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _build_overlay_mount(root_mount, mounts):
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
if not root_mount:
|
||||
@@ -480,8 +480,8 @@ def _create_mount_disk_image(disk_images_directory, path, disk_size):
|
||||
# NOTE(pstodulk): In case the formatting params are modified,
|
||||
# the minimal required size could be different
|
||||
api.current_logger().warning(
|
||||
- 'The apparent size for the disk image representing {path}'
|
||||
- ' is too small ({disk_size} MiBs) for a formatting. Setting 130 MiBs instead.'
|
||||
+ 'The apparent size for the disk image representing {path} '
|
||||
+ 'is too small ({disk_size} MiBs) for a formatting. Setting 130 MiBs instead.'
|
||||
.format(path=path, disk_size=disk_size)
|
||||
)
|
||||
disk_size = 130
|
||||
@@ -489,12 +489,11 @@ def _create_mount_disk_image(disk_images_directory, path, disk_size):
|
||||
cmd = [
|
||||
'/bin/dd',
|
||||
'if=/dev/zero', 'of={}'.format(diskimage_path),
|
||||
- 'bs=1M', 'count=0', 'seek={}'.format(disk_size)
|
||||
+ 'bs=1M', 'count=0', 'seek={}'.format(disk_size),
|
||||
]
|
||||
hint = (
|
||||
'Please ensure that there is enough diskspace on the partition hosting'
|
||||
- 'the {} directory.'
|
||||
- .format(disk_images_directory)
|
||||
+ 'the {} directory.'.format(disk_images_directory)
|
||||
)
|
||||
|
||||
api.current_logger().debug('Attempting to create disk image at %s', diskimage_path)
|
||||
@@ -540,7 +539,9 @@ def _create_mounts_dir(scratch_dir, mounts_dir):
|
||||
utils.makedirs(mounts_dir)
|
||||
api.current_logger().debug('Done creating mount directories.')
|
||||
except OSError:
|
||||
- api.current_logger().error('Failed to create mounting directories %s', mounts_dir, exc_info=True)
|
||||
+ api.current_logger().error(
|
||||
+ 'Failed to create mounting directories %s', mounts_dir, exc_info=True
|
||||
+ )
|
||||
|
||||
# This is an attempt for giving the user a chance to resolve it on their own
|
||||
raise StopActorExecutionError(
|
||||
@@ -556,17 +557,25 @@ def _mount_dnf_cache(overlay_target):
|
||||
"""
|
||||
Convenience context manager to ensure bind mounted /var/cache/dnf and removal of the mount.
|
||||
"""
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
with mounting.BindMount(
|
||||
- source='/var/cache/dnf',
|
||||
- target=os.path.join(overlay_target, 'var', 'cache', 'dnf')) as cache_mount:
|
||||
+ source='/var/cache/dnf',
|
||||
+ target=os.path.join(overlay_target, 'var', 'cache', 'dnf'),
|
||||
+ ) as cache_mount:
|
||||
yield cache_mount
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
-def create_source_overlay(mounts_dir, scratch_dir, xfs_info, storage_info, mount_target=None, scratch_reserve=0):
|
||||
+def create_source_overlay(
|
||||
+ mounts_dir,
|
||||
+ scratch_dir,
|
||||
+ xfs_info,
|
||||
+ storage_info,
|
||||
+ mount_target=None,
|
||||
+ scratch_reserve=0,
|
||||
+):
|
||||
"""
|
||||
Context manager that prepares the source system overlay and yields the mount.
|
||||
|
||||
@@ -610,7 +619,7 @@ def create_source_overlay(mounts_dir, scratch_dir, xfs_info, storage_info, mount
|
||||
:type scratch_reserve: Optional[int]
|
||||
:rtype: mounting.BindMount or mounting.NullMount
|
||||
"""
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
api.current_logger().debug('Creating source overlay in {scratch_dir} with mounts in {mounts_dir}'.format(
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
index 8e866455..13e782e6 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -168,7 +168,8 @@ def test_get_distro_repoids(
|
||||
monkeypatch.setattr(os.path, 'exists', lambda f: f in _CENTOS_REPOFILES)
|
||||
|
||||
class MockedContext:
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return path
|
||||
|
||||
repoids = get_distro_repoids(MockedContext(), distro_id, '9', 'x86_64')
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_grub.py b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
index d6f428bb..08dc6895 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
@@ -23,7 +23,7 @@ INVALID_DD = b'Nothing to see here!'
|
||||
|
||||
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
-# pylint: disable=E501
|
||||
+# pylint: disable=line-too-long
|
||||
# flake8: noqa: E501
|
||||
EFIBOOTMGR_OUTPUT = r"""
|
||||
BootCurrent: 0006
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_rhsm.py b/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
index 84a1bd5e..b118da29 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
@@ -73,7 +73,8 @@ class IsolatedActionsMocked:
|
||||
# A map from called commands to their mocked output
|
||||
self.mocked_command_call_outputs = dict()
|
||||
|
||||
- def is_isolated(self):
|
||||
+ @staticmethod
|
||||
+ def is_isolated():
|
||||
return True
|
||||
|
||||
def call(self, cmd, *args, **dummy_kwargs):
|
||||
@@ -93,7 +94,8 @@ class IsolatedActionsMocked:
|
||||
'exit_code': exit_code
|
||||
}
|
||||
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return path
|
||||
|
||||
def remove(self, path):
|
||||
diff --git a/repos/system_upgrade/common/libraries/testutils.py b/repos/system_upgrade/common/libraries/testutils.py
|
||||
index 328a7ede..e84cc03a 100644
|
||||
--- a/repos/system_upgrade/common/libraries/testutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/testutils.py
|
||||
@@ -120,7 +120,7 @@ class CurrentActorMocked: # pylint:disable=R0904
|
||||
return os.path.join(self._common_tools_folder, name)
|
||||
|
||||
def consume(self, model):
|
||||
- return iter(filter( # pylint:disable=W0110,W1639
|
||||
+ return iter(filter(
|
||||
lambda msg: isinstance(msg, model), self._msgs
|
||||
))
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py b/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
index 865e036f..d7cfb4fb 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
@@ -15,13 +15,15 @@ from leapp.utils.report import is_inhibitor
|
||||
|
||||
# Mock actor base for CheckVdo tests.
|
||||
class MockedActorCheckVdo(CurrentActorMocked):
|
||||
- def get_vdo_answer(self):
|
||||
+ @staticmethod
|
||||
+ def get_vdo_answer():
|
||||
return False
|
||||
|
||||
|
||||
# Mock actor for all_vdo_converted dialog response.
|
||||
class MockedActorAllVdoConvertedTrue(MockedActorCheckVdo):
|
||||
- def get_vdo_answer(self):
|
||||
+ @staticmethod
|
||||
+ def get_vdo_answer():
|
||||
return True
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py b/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
index 9910f748..ae51c69d 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
@@ -14,7 +14,8 @@ class NISScanLibrary:
|
||||
Helper library for NISScan actor.
|
||||
"""
|
||||
|
||||
- def client_has_non_default_configuration(self):
|
||||
+ @staticmethod
|
||||
+ def client_has_non_default_configuration():
|
||||
"""
|
||||
Check for any significant ypbind configuration lines in .conf file.
|
||||
"""
|
||||
@@ -31,7 +32,8 @@ class NISScanLibrary:
|
||||
return True
|
||||
return False
|
||||
|
||||
- def server_has_non_default_configuration(self):
|
||||
+ @staticmethod
|
||||
+ def server_has_non_default_configuration():
|
||||
"""
|
||||
Check for any additional (not default) files in ypserv DIR.
|
||||
"""
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
index f36a62e1..07c1b22f 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
@@ -115,7 +115,8 @@ def _openssl_reachable_key(config, key, value=None):
|
||||
return False
|
||||
|
||||
|
||||
-# pylint: disable=too-many-return-statements -- could not simplify more
|
||||
+# pylint: disable=too-many-return-statements
|
||||
+# could not simplify more
|
||||
def _openssl_reachable_path(config, path, value=None):
|
||||
"""
|
||||
Check if the given path is reachable in OpenSSL configuration
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,182 +0,0 @@
|
||||
From 2abc41bb019a0ebef73e48f2a50990d8e5038e51 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 15:16:36 +0200
|
||||
Subject: [PATCH 41/55] pylint: enable super-with-arguments
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../unit_test_applytransactionworkarounds.py | 2 +-
|
||||
.../common/files/rhel_upgrade.py | 4 +--
|
||||
.../common/libraries/mounting.py | 28 +++++++++++--------
|
||||
.../common/libraries/repofileutils.py | 2 +-
|
||||
5 files changed, 20 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 0cba1129..4cfc49e0 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -40,7 +40,6 @@ disable=
|
||||
too-many-positional-arguments,
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
diff --git a/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py b/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
index 369514fc..96b8094f 100644
|
||||
--- a/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
+++ b/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
@@ -7,7 +7,7 @@ from leapp.models import DNFWorkaround
|
||||
|
||||
class ShowMessageCurrentActorMocked(CurrentActorMocked):
|
||||
def __init__(self, *args, **kwargs):
|
||||
- super(ShowMessageCurrentActorMocked, self).__init__(*args, **kwargs)
|
||||
+ super().__init__(*args, **kwargs)
|
||||
self._show_messages = []
|
||||
|
||||
@property
|
||||
diff --git a/repos/system_upgrade/common/files/rhel_upgrade.py b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
index a5d7045b..63910fe0 100644
|
||||
--- a/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
+++ b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
@@ -40,7 +40,7 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
summary = 'Plugin for upgrading to the next RHEL major release'
|
||||
|
||||
def __init__(self, cli):
|
||||
- super(RhelUpgradeCommand, self).__init__(cli)
|
||||
+ super().__init__(cli)
|
||||
self.plugin_data = {}
|
||||
|
||||
@staticmethod
|
||||
@@ -225,6 +225,6 @@ class RhelUpgradePlugin(dnf.Plugin):
|
||||
name = 'rhel-upgrade'
|
||||
|
||||
def __init__(self, base, cli):
|
||||
- super(RhelUpgradePlugin, self).__init__(base, cli)
|
||||
+ super().__init__(base, cli)
|
||||
if cli:
|
||||
cli.register_command(RhelUpgradeCommand)
|
||||
diff --git a/repos/system_upgrade/common/libraries/mounting.py b/repos/system_upgrade/common/libraries/mounting.py
|
||||
index ae3885cf..279d31dc 100644
|
||||
--- a/repos/system_upgrade/common/libraries/mounting.py
|
||||
+++ b/repos/system_upgrade/common/libraries/mounting.py
|
||||
@@ -46,7 +46,7 @@ class MountError(Exception):
|
||||
""" Exception that is thrown when a mount related operation failed """
|
||||
|
||||
def __init__(self, message, details):
|
||||
- super(MountError, self).__init__(message)
|
||||
+ super().__init__(message)
|
||||
self.details = details
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class IsolationType:
|
||||
""" systemd-nspawn implementation """
|
||||
|
||||
def __init__(self, target, binds=(), env_vars=None):
|
||||
- super(IsolationType.NSPAWN, self).__init__(target=target)
|
||||
+ super().__init__(target=target)
|
||||
self.binds = list(binds) + ALWAYS_BIND
|
||||
self.env_vars = env_vars or get_all_envs()
|
||||
|
||||
@@ -98,7 +98,7 @@ class IsolationType:
|
||||
""" chroot implementation """
|
||||
|
||||
def __init__(self, target):
|
||||
- super(IsolationType.CHROOT, self).__init__(target)
|
||||
+ super().__init__(target)
|
||||
self.context = None
|
||||
|
||||
def create(self):
|
||||
@@ -262,14 +262,14 @@ class ChrootActions(IsolatedActions):
|
||||
""" Isolation with chroot """
|
||||
|
||||
def __init__(self, base_dir):
|
||||
- super(ChrootActions, self).__init__(base_dir=base_dir, implementation=IsolationType.CHROOT)
|
||||
+ super().__init__(base_dir=base_dir, implementation=IsolationType.CHROOT)
|
||||
|
||||
|
||||
class NspawnActions(IsolatedActions):
|
||||
""" Isolation with systemd-nspawn """
|
||||
|
||||
def __init__(self, base_dir, binds=(), env_vars=None):
|
||||
- super(NspawnActions, self).__init__(
|
||||
+ super().__init__(
|
||||
base_dir=base_dir, implementation=IsolationType.NSPAWN, binds=binds, env_vars=env_vars)
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ class NotIsolatedActions(IsolatedActions):
|
||||
_isolated = False
|
||||
|
||||
def __init__(self, base_dir):
|
||||
- super(NotIsolatedActions, self).__init__(base_dir=base_dir, implementation=IsolationType.NONE)
|
||||
+ super().__init__(base_dir=base_dir, implementation=IsolationType.NONE)
|
||||
|
||||
|
||||
class MountConfig:
|
||||
@@ -375,7 +375,7 @@ class NullMount(MountingBase):
|
||||
""" This is basically a NoOp for compatibility with other mount operations, in case a mount is optional """
|
||||
|
||||
def __init__(self, target, config=MountConfig.AttachOnly):
|
||||
- super(NullMount, self).__init__(source=target, target=target, mode=MountingMode.NONE, config=config)
|
||||
+ super().__init__(source=target, target=target, mode=MountingMode.NONE, config=config)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
@@ -388,21 +388,21 @@ class LoopMount(MountingBase):
|
||||
""" Performs loop mounts """
|
||||
|
||||
def __init__(self, source, target, config=MountConfig.Mount):
|
||||
- super(LoopMount, self).__init__(source=source, target=target, mode=MountingMode.LOOP, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.LOOP, config=config)
|
||||
|
||||
|
||||
class BindMount(MountingBase):
|
||||
""" Performs bind mounts """
|
||||
|
||||
def __init__(self, source, target, config=MountConfig.Mount):
|
||||
- super(BindMount, self).__init__(source=source, target=target, mode=MountingMode.BIND, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.BIND, config=config)
|
||||
|
||||
|
||||
class TypedMount(MountingBase):
|
||||
""" Performs a typed mounts """
|
||||
|
||||
def __init__(self, fstype, source, target, config=MountConfig.Mount):
|
||||
- super(TypedMount, self).__init__(source=source, target=target, mode=MountingMode.FSTYPE, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.FSTYPE, config=config)
|
||||
self.fstype = fstype
|
||||
|
||||
def _mount_options(self):
|
||||
@@ -416,8 +416,12 @@ class OverlayMount(MountingBase):
|
||||
""" Performs an overlayfs mount """
|
||||
|
||||
def __init__(self, name, source, workdir, config=MountConfig.Mount):
|
||||
- super(OverlayMount, self).__init__(source=source, target=os.path.join(workdir, name),
|
||||
- mode=MountingMode.OVERLAY, config=config)
|
||||
+ super().__init__(
|
||||
+ source=source,
|
||||
+ target=os.path.join(workdir, name),
|
||||
+ mode=MountingMode.OVERLAY,
|
||||
+ config=config
|
||||
+ )
|
||||
self._upper_dir = os.path.join(workdir, 'upper')
|
||||
self._work_dir = os.path.join(workdir, 'work')
|
||||
self.additional_directories = (self._upper_dir, self._work_dir)
|
||||
diff --git a/repos/system_upgrade/common/libraries/repofileutils.py b/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
index cab3c42b..376473a4 100644
|
||||
--- a/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
@@ -16,7 +16,7 @@ class InvalidRepoDefinition(Exception):
|
||||
def __init__(self, msg, repofile, repoid):
|
||||
message = 'Invalid repository definition: {repoid} in: {repofile}: {msg}'.format(
|
||||
repoid=repoid, repofile=repofile, msg=msg)
|
||||
- super(InvalidRepoDefinition, self).__init__(message)
|
||||
+ super().__init__(message)
|
||||
self.repofile = repofile
|
||||
self.repoid = repoid
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,203 +0,0 @@
|
||||
From 215f307eeb1362e420ac08f528f9f11d6c1c974d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 8 Sep 2025 08:10:13 +0200
|
||||
Subject: [PATCH 42/55] pylint: enable use-a-generator
|
||||
|
||||
Comprehensions inside functions like any(), all(), max(), min(), or sum()
|
||||
are unnecessary. Enabling this warning enforces using generator expressions
|
||||
instead of full list/set comprehensions in these cases.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 2 +-
|
||||
.../actors/checksaphana/tests/test_checksaphana.py | 7 +++++--
|
||||
.../tests/test_ddddload.py | 2 +-
|
||||
.../tests/test_persistentnetnamesconfig.py | 2 +-
|
||||
.../libraries/scandynamiclinkerconfiguration.py | 2 +-
|
||||
.../tests/test_checksystemdbrokensymlinks.py | 4 ++--
|
||||
.../tests/test_transitionsystemdservicesstates.py | 6 ++----
|
||||
.../tests/unit_test_targetuserspacecreator.py | 4 ++--
|
||||
.../actors/rocecheck/tests/unit_test_rocecheck.py | 10 ++++++++--
|
||||
10 files changed, 23 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 4cfc49e0..a82f8818 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -41,7 +41,6 @@ disable=
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
- use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
logging-format-interpolation
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index d52b9e73..84e8e61f 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -27,7 +27,7 @@ def _formatted_list_output(input_list, sep=FMT_LIST_SEPARATOR):
|
||||
|
||||
|
||||
def _at_least_one_tpm_token(luks_dump):
|
||||
- return any([token.token_type == "clevis-tpm2" for token in luks_dump.tokens])
|
||||
+ return any(token.token_type == "clevis-tpm2" for token in luks_dump.tokens)
|
||||
|
||||
|
||||
def _get_ceph_volumes():
|
||||
diff --git a/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py b/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
index 29e9c930..8ec8d17f 100644
|
||||
--- a/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
+++ b/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
@@ -284,7 +284,7 @@ def test_checksaphana_perform_check(monkeypatch):
|
||||
# Expected 3 reports due to v1names + v2lownames + running
|
||||
assert len(reports) == 3
|
||||
# Verifies that all expected title patterns are within the reports and not just coincidentally 3
|
||||
- assert all([any([pattern(report) for report in reports]) for pattern in EXPECTED_TITLE_PATTERNS.values()])
|
||||
+ assert all(any(pattern(report) for report in reports) for pattern in EXPECTED_TITLE_PATTERNS.values())
|
||||
|
||||
list_clear(reports)
|
||||
monkeypatch.setattr(checksaphana.api, 'consume', _consume_mock_sap_hana_info(
|
||||
@@ -294,4 +294,7 @@ def test_checksaphana_perform_check(monkeypatch):
|
||||
# Expected 2 reports due to v1names + v2lownames
|
||||
assert len(reports) == 2
|
||||
# Verifies that all expected title patterns are within the reports and not just coincidentally 2
|
||||
- assert all([any([EXPECTED_TITLE_PATTERNS[pattern](report) for report in reports]) for pattern in ['v1', 'low']])
|
||||
+ assert all(
|
||||
+ any(EXPECTED_TITLE_PATTERNS[pattern](report) for report in reports)
|
||||
+ for pattern in ['v1', 'low']
|
||||
+ )
|
||||
diff --git a/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py b/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
index c3386745..1f3473b6 100644
|
||||
--- a/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
+++ b/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
@@ -60,7 +60,7 @@ def test_filtered_load(monkeypatch):
|
||||
|
||||
assert produced
|
||||
assert len(produced[0].entries) == 3
|
||||
- assert not any([e.device_type == 'unsupported' for e in produced[0].entries])
|
||||
+ assert not any(e.device_type == 'unsupported' for e in produced[0].entries)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('data', (
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
index 5ad52c43..ee199ae4 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
@@ -177,7 +177,7 @@ def test_bz_1899455_crash_iface(monkeypatch, adjust_cwd):
|
||||
|
||||
for prod_models in [RenamedInterfaces, InitrdIncludes, TargetInitramfsTasks]:
|
||||
any(isinstance(i, prod_models) for i in persistentnetnamesconfig.api.produce.model_instances)
|
||||
- assert any(['Some network devices' in x for x in persistentnetnamesconfig.api.current_logger.warnmsg])
|
||||
+ assert any('Some network devices' in x for x in persistentnetnamesconfig.api.current_logger.warnmsg)
|
||||
|
||||
|
||||
def test_no_network_renaming(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py b/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
index 8d3b473e..73b0c84e 100644
|
||||
--- a/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
+++ b/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
@@ -113,5 +113,5 @@ def scan_dynamic_linker_configuration():
|
||||
included_configs=included_config_files,
|
||||
used_variables=used_variables)
|
||||
|
||||
- if other_lines or any([config.modified for config in included_config_files]) or used_variables:
|
||||
+ if other_lines or any(config.modified for config in included_config_files) or used_variables:
|
||||
api.produce(configuration)
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py b/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
index bcc33f13..a4c0a657 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
@@ -20,7 +20,7 @@ def test_report_broken_symlinks(monkeypatch):
|
||||
checksystemdbrokensymlinks._report_broken_symlinks(symlinks)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields['summary'] for s in symlinks])
|
||||
+ assert all(s in created_reports.report_fields['summary'] for s in symlinks)
|
||||
|
||||
|
||||
def test_report_enabled_services_broken_symlinks(monkeypatch):
|
||||
@@ -35,7 +35,7 @@ def test_report_enabled_services_broken_symlinks(monkeypatch):
|
||||
checksystemdbrokensymlinks._report_enabled_services_broken_symlinks(symlinks)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields['summary'] for s in symlinks])
|
||||
+ assert all(s in created_reports.report_fields['summary'] for s in symlinks)
|
||||
|
||||
|
||||
class ReportBrokenSymlinks:
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py b/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
index 6964a65b..488b37d4 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
@@ -205,9 +205,7 @@ def test_report_kept_enabled(monkeypatch, tasks, expect_extended_summary):
|
||||
assert created_reports.called
|
||||
if expect_extended_summary:
|
||||
assert extended_summary_str in created_reports.report_fields["summary"]
|
||||
- assert all(
|
||||
- [s in created_reports.report_fields["summary"] for s in tasks.to_enable]
|
||||
- )
|
||||
+ all(s in created_reports.report_fields['summary'] for s in tasks.to_enable)
|
||||
else:
|
||||
assert extended_summary_str not in created_reports.report_fields["summary"]
|
||||
|
||||
@@ -238,7 +236,7 @@ def test_report_newly_enabled(monkeypatch):
|
||||
transitionsystemdservicesstates._report_newly_enabled(newly_enabled)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields["summary"] for s in newly_enabled])
|
||||
+ assert all(s in created_reports.report_fields["summary"] for s in newly_enabled)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index bb17d89a..0bb64f6f 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -1068,7 +1068,7 @@ def test_consume_data(monkeypatch, raised, no_rhsm, testdata):
|
||||
assert raised[1] in err.value.message
|
||||
else:
|
||||
assert userspacegen.api.current_logger.warnmsg
|
||||
- assert any([raised[1] in x for x in userspacegen.api.current_logger.warnmsg])
|
||||
+ assert any(raised[1] in x for x in userspacegen.api.current_logger.warnmsg)
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Currently not implemented in the actor. It's TODO.")
|
||||
@@ -1390,7 +1390,7 @@ def test__get_files_owned_by_rpms_recursive(monkeypatch):
|
||||
assert sorted(owned[0:4]) == sorted(out)
|
||||
|
||||
def has_dbgmsg(substr):
|
||||
- return any([substr in log for log in logger.dbgmsg])
|
||||
+ return any(substr in log for log in logger.dbgmsg)
|
||||
|
||||
# test a few
|
||||
assert has_dbgmsg(
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py b/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
index a36cc8ed..b5511d17 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
@@ -91,7 +91,10 @@ def test_roce_old_rhel(monkeypatch, msgs, version):
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
rocecheck.process()
|
||||
assert reporting.create_report.called
|
||||
- assert any(['version of RHEL' in report['title'] for report in reporting.create_report.reports])
|
||||
+ assert any(
|
||||
+ 'version of RHEL' in report['title']
|
||||
+ for report in reporting.create_report.reports
|
||||
+ )
|
||||
|
||||
|
||||
# NOTE: what about the situation when net.naming-scheme is configured multiple times???
|
||||
@@ -113,4 +116,7 @@ def test_roce_wrong_configuration(monkeypatch, msgs, version):
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
rocecheck.process()
|
||||
assert reporting.create_report.called
|
||||
- assert any(['RoCE configuration' in report['title'] for report in reporting.create_report.reports])
|
||||
+ assert any(
|
||||
+ 'RoCE configuration' in report['title']
|
||||
+ for report in reporting.create_report.reports
|
||||
+ )
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,484 +0,0 @@
|
||||
From adac307afff48ebbf4255edbd620ed29cbc9429e Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 13:12:19 +0200
|
||||
Subject: [PATCH 43/55] Set CurrentActorMocked src/dst version to 8->9 values
|
||||
|
||||
Currently, the default upgrade path is 7.8->8.1 which has been dropped
|
||||
from the repo. Several tests make assumptions about these defaults and in
|
||||
some cases this means that code path for other general upgrade paths
|
||||
(8->9, 9->10) are left untested e.g. modify_userspace_for_livemode.
|
||||
|
||||
This patch changes the default path to 8.10->9.6.
|
||||
|
||||
Updated tests:
|
||||
- checkrhui: assume 8->9 upgrade path
|
||||
- setuptargetrepos: Update tests to assume 8->9 upg path.
|
||||
- repairsystemdsymlinks: use 8->9 upgrade path instead of 7->8:
|
||||
We need to mock some "installation changed" service as there is
|
||||
*currently* none.
|
||||
- checkmemory: assume 8->9 upgrade path
|
||||
- peseventsscanner: assume 8->9 upgrade path
|
||||
- lib/config: assume correct upgrade path
|
||||
- persistentnetnamesconfig: use 8->9 upgrade path instead of 7->8
|
||||
|
||||
Jira: RHELMISC-16538
|
||||
---
|
||||
.../checkmemory/tests/test_checkmemory.py | 2 +-
|
||||
.../tests/component_test_checkrhui.py | 20 +++---
|
||||
.../libraries/persistentnetnamesconfig.py | 24 +++----
|
||||
.../tests/test_persistentnetnamesconfig.py | 16 ++++-
|
||||
.../tests/test_pes_event_scanner.py | 14 ++--
|
||||
.../tests/test_setuptargetrepos.py | 68 +++++++++----------
|
||||
.../libraries/repairsystemdsymlinks.py | 1 -
|
||||
.../tests/test_repairsystemdsymlinks.py | 29 +++++---
|
||||
.../libraries/config/tests/test_version.py | 2 +-
|
||||
.../common/libraries/testutils.py | 2 +-
|
||||
10 files changed, 98 insertions(+), 80 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py b/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
index a0bac0a9..79158dc6 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
@@ -21,7 +21,7 @@ def test_check_memory_high(monkeypatch):
|
||||
|
||||
|
||||
def test_report(monkeypatch):
|
||||
- title_msg = 'Minimum memory requirements for RHEL 8 are not met'
|
||||
+ title_msg = 'Minimum memory requirements for RHEL 9 are not met'
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(api, 'consume', lambda x: iter([MemoryInfo(mem_total=129)]))
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
index 02ca352e..2e6f279e 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
@@ -279,10 +279,14 @@ class ExpectedAction(Enum):
|
||||
)
|
||||
def test_process(monkeypatch, extra_installed_pkgs, skip_rhsm, expected_action):
|
||||
known_setups = {
|
||||
- RHUIFamily('rhui-variant'): [
|
||||
- mk_rhui_setup(clients={'src_pkg'}, os_version='7'),
|
||||
- mk_rhui_setup(clients={'target_pkg'}, os_version='8', leapp_pkg='leapp_pkg',
|
||||
- mandatory_files=[('file1', '/etc'), ('file2', '/var')]),
|
||||
+ RHUIFamily("rhui-variant"): [
|
||||
+ mk_rhui_setup(clients={"src_pkg"}, os_version="8"),
|
||||
+ mk_rhui_setup(
|
||||
+ clients={"target_pkg"},
|
||||
+ os_version="9",
|
||||
+ leapp_pkg="leapp_pkg",
|
||||
+ mandatory_files=[("file1", "/etc"), ("file2", "/var")],
|
||||
+ ),
|
||||
]
|
||||
}
|
||||
|
||||
@@ -291,7 +295,7 @@ def test_process(monkeypatch, extra_installed_pkgs, skip_rhsm, expected_action):
|
||||
installed_rpms = InstalledRPM(items=installed_pkgs)
|
||||
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- actor = CurrentActorMocked(src_ver='7.9', msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
+ actor = CurrentActorMocked(msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
monkeypatch.setattr(api, 'current_actor', actor)
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
@@ -318,12 +322,12 @@ def test_unknown_target_rhui_setup(monkeypatch, is_target_setup_known):
|
||||
rhui_family = RHUIFamily('rhui-variant')
|
||||
known_setups = {
|
||||
rhui_family: [
|
||||
- mk_rhui_setup(clients={'src_pkg'}, os_version='7'),
|
||||
+ mk_rhui_setup(clients={'src_pkg'}, os_version='8'),
|
||||
]
|
||||
}
|
||||
|
||||
if is_target_setup_known:
|
||||
- target_setup = mk_rhui_setup(clients={'target_pkg'}, os_version='8', leapp_pkg='leapp_pkg')
|
||||
+ target_setup = mk_rhui_setup(clients={'target_pkg'}, os_version='9', leapp_pkg='leapp_pkg')
|
||||
known_setups[rhui_family].append(target_setup)
|
||||
|
||||
installed_pkgs = {'zip', 'kernel-core', 'python', 'src_pkg', 'leapp_pkg'}
|
||||
@@ -331,7 +335,7 @@ def test_unknown_target_rhui_setup(monkeypatch, is_target_setup_known):
|
||||
installed_rpms = InstalledRPM(items=installed_pkgs)
|
||||
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- actor = CurrentActorMocked(src_ver='7.9', msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
+ actor = CurrentActorMocked(msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
monkeypatch.setattr(api, 'current_actor', actor)
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
index c90d13f2..189cd4d0 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
@@ -55,21 +55,21 @@ def process():
|
||||
)
|
||||
return
|
||||
|
||||
- rhel7_ifaces = next(api.consume(PersistentNetNamesFacts)).interfaces
|
||||
- rhel8_ifaces = next(api.consume(PersistentNetNamesFactsInitramfs)).interfaces
|
||||
+ source_ifaces = next(api.consume(PersistentNetNamesFacts)).interfaces
|
||||
+ target_ifaces = next(api.consume(PersistentNetNamesFactsInitramfs)).interfaces
|
||||
|
||||
- rhel7_ifaces_map = {iface.mac: iface for iface in rhel7_ifaces}
|
||||
- rhel8_ifaces_map = {iface.mac: iface for iface in rhel8_ifaces}
|
||||
+ source_ifaces_map = {iface.mac: iface for iface in source_ifaces}
|
||||
+ target_ifaces_map = {iface.mac: iface for iface in target_ifaces}
|
||||
|
||||
initrd_files = []
|
||||
missing_ifaces = []
|
||||
renamed_interfaces = []
|
||||
|
||||
- if rhel7_ifaces != rhel8_ifaces:
|
||||
- for iface in rhel7_ifaces:
|
||||
- rhel7_name = rhel7_ifaces_map[iface.mac].name
|
||||
+ if source_ifaces != target_ifaces:
|
||||
+ for iface in source_ifaces:
|
||||
+ source_name = source_ifaces_map[iface.mac].name
|
||||
try:
|
||||
- rhel8_name = rhel8_ifaces_map[iface.mac].name
|
||||
+ target_name = target_ifaces_map[iface.mac].name
|
||||
except KeyError:
|
||||
missing_ifaces.append(iface)
|
||||
api.current_logger().warning(
|
||||
@@ -80,13 +80,13 @@ def process():
|
||||
)
|
||||
continue
|
||||
|
||||
- if rhel7_name != rhel8_name and get_env('LEAPP_NO_NETWORK_RENAMING', '0') != '1':
|
||||
- api.current_logger().warning('Detected interface rename {} -> {}.'.format(rhel7_name, rhel8_name))
|
||||
+ if source_name != target_name and get_env('LEAPP_NO_NETWORK_RENAMING', '0') != '1':
|
||||
+ api.current_logger().warning('Detected interface rename {} -> {}.'.format(source_name, target_name))
|
||||
|
||||
if re.search('eth[0-9]+', iface.name) is not None:
|
||||
api.current_logger().warning('Interface named using eth prefix, refusing to generate link file')
|
||||
- renamed_interfaces.append(RenamedInterface(**{'rhel7_name': rhel7_name,
|
||||
- 'rhel8_name': rhel8_name}))
|
||||
+ renamed_interfaces.append(RenamedInterface(**{'rhel7_name': source_name,
|
||||
+ 'rhel8_name': target_name}))
|
||||
continue
|
||||
|
||||
initrd_files.append(generate_link_file(iface))
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
index ee199ae4..c584c7ea 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
@@ -12,7 +12,6 @@ from leapp.models import (
|
||||
PCIAddress,
|
||||
PersistentNetNamesFacts,
|
||||
PersistentNetNamesFactsInitramfs,
|
||||
- RenamedInterface,
|
||||
RenamedInterfaces,
|
||||
TargetInitramfsTasks
|
||||
)
|
||||
@@ -170,7 +169,12 @@ def test_bz_1899455_crash_iface(monkeypatch, adjust_cwd):
|
||||
PersistentNetNamesFactsInitramfs.create(json_msgs["PersistentNetNamesFactsInitramfs"]),
|
||||
]
|
||||
monkeypatch.setattr(persistentnetnamesconfig, 'generate_link_file', generate_link_file_mocked)
|
||||
- monkeypatch.setattr(persistentnetnamesconfig.api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(
|
||||
+ persistentnetnamesconfig.api,
|
||||
+ "current_actor",
|
||||
+ # without this the actor exits early
|
||||
+ CurrentActorMocked(msgs=msgs, envars={"LEAPP_DISABLE_NET_NAMING_SCHEMES": "1"}),
|
||||
+ )
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_logger', logger_mocked())
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'produce', produce_mocked())
|
||||
persistentnetnamesconfig.process()
|
||||
@@ -194,7 +198,13 @@ def test_no_network_renaming(monkeypatch):
|
||||
msgs = [PersistentNetNamesFacts(interfaces=interfaces)]
|
||||
interfaces[0].name = 'changedinterfacename0'
|
||||
msgs.append(PersistentNetNamesFactsInitramfs(interfaces=interfaces))
|
||||
- mocked_actor = CurrentActorMocked(msgs=msgs, envars={'LEAPP_NO_NETWORK_RENAMING': '1'})
|
||||
+ mocked_actor = CurrentActorMocked(
|
||||
+ msgs=msgs,
|
||||
+ envars={
|
||||
+ "LEAPP_DISABLE_NET_NAMING_SCHEMES": "1",
|
||||
+ "LEAPP_NO_NETWORK_RENAMING": "1",
|
||||
+ },
|
||||
+ )
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_actor', mocked_actor)
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_logger', logger_mocked())
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'produce', produce_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
index 09a1e82d..f67f3840 100644
|
||||
--- a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
@@ -325,18 +325,18 @@ def test_blacklisted_repoid_is_not_produced(monkeypatch):
|
||||
Test that upgrade with a package that would be from a blacklisted repository on the target system does not remove
|
||||
the package as it was already installed, however, the blacklisted repoid should not be produced.
|
||||
"""
|
||||
- installed_pkgs = {Package('pkg-a', 'blacklisted-rhel7', None), Package('pkg-b', 'repoid-rhel7', None)}
|
||||
+ installed_pkgs = {Package('pkg-a', 'blacklisted-rhel8', None), Package('pkg-b', 'repoid-rhel8', None)}
|
||||
events = [
|
||||
- Event(1, Action.MOVED, {Package('pkg-b', 'repoid-rhel7', None)}, {Package('pkg-b', 'repoid-rhel8', None)},
|
||||
- (8, 0), (8, 1), []),
|
||||
- Event(2, Action.MOVED, {Package('pkg-a', 'repoid-rhel7', None)}, {Package('pkg-a', 'blacklisted-rhel8', None)},
|
||||
- (8, 0), (8, 1), []),
|
||||
+ Event(1, Action.MOVED, {Package('pkg-b', 'repoid-rhel8', None)}, {Package('pkg-b', 'repoid-rhel9', None)},
|
||||
+ (9, 0), (9, 1), []),
|
||||
+ Event(2, Action.MOVED, {Package('pkg-a', 'repoid-rhel8', None)}, {Package('pkg-a', 'blacklisted-rhel9', None)},
|
||||
+ (9, 0), (9, 1), []),
|
||||
]
|
||||
|
||||
monkeypatch.setattr(pes_events_scanner, 'get_installed_pkgs', lambda: installed_pkgs)
|
||||
monkeypatch.setattr(pes_events_scanner, 'get_pes_events', lambda folder, filename: events)
|
||||
monkeypatch.setattr(pes_events_scanner, 'apply_transaction_configuration', lambda pkgs, transaction_cfg: pkgs)
|
||||
- monkeypatch.setattr(pes_events_scanner, 'get_blacklisted_repoids', lambda: {'blacklisted-rhel8'})
|
||||
+ monkeypatch.setattr(pes_events_scanner, 'get_blacklisted_repoids', lambda: {'blacklisted-rhel9'})
|
||||
monkeypatch.setattr(pes_events_scanner, 'replace_pesids_with_repoids_in_packages',
|
||||
lambda pkgs, src_pkgs_repoids: pkgs)
|
||||
|
||||
@@ -357,7 +357,7 @@ def test_blacklisted_repoid_is_not_produced(monkeypatch):
|
||||
|
||||
repo_setup_tasks = [msg for msg in api.produce.model_instances if isinstance(msg, RepositoriesSetupTasks)]
|
||||
assert len(repo_setup_tasks) == 1
|
||||
- assert repo_setup_tasks[0].to_enable == ['repoid-rhel8']
|
||||
+ assert repo_setup_tasks[0].to_enable == ['repoid-rhel9']
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
index e4a30f7f..ce7f01c0 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
@@ -1,6 +1,5 @@
|
||||
import pytest
|
||||
|
||||
-from leapp.libraries import stdlib
|
||||
from leapp.libraries.actor import setuptargetrepos
|
||||
from leapp.libraries.common.testutils import CurrentActorMocked, produce_mocked
|
||||
from leapp.libraries.stdlib import api
|
||||
@@ -15,8 +14,7 @@ from leapp.models import (
|
||||
RepositoriesSetupTasks,
|
||||
RepositoryData,
|
||||
RepositoryFile,
|
||||
- RPM,
|
||||
- TargetRepositories
|
||||
+ RPM
|
||||
)
|
||||
|
||||
RH_PACKAGER = 'Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>'
|
||||
@@ -108,27 +106,27 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
the RepositoriesMapping information for a specific distro.
|
||||
"""
|
||||
repos_data = [
|
||||
- RepositoryData(repoid='{}-7-server-rpms'.format(distro_id), name='{} 7 Server'.format(distro_id)),
|
||||
- RepositoryData(repoid='{}-7-blacklisted-rpms'.format(distro_id), name='{} 7 Blacklisted'.format(distro_id))]
|
||||
+ RepositoryData(repoid='{}-8-server-rpms'.format(distro_id), name='{} 8 Server'.format(distro_id)),
|
||||
+ RepositoryData(repoid='{}-8-blacklisted-rpms'.format(distro_id), name='{} 8 Blacklisted'.format(distro_id))]
|
||||
|
||||
repos_files = [RepositoryFile(file='/etc/yum.repos.d/redhat.repo', data=repos_data)]
|
||||
facts = RepositoriesFacts(repositories=repos_files)
|
||||
installed_rpms = InstalledRPM(
|
||||
- items=[mock_package('foreman', '{}-7-for-x86_64-satellite-extras-rpms'.format(distro_id)),
|
||||
- mock_package('foreman-proxy', 'nosuch-{}-7-for-x86_64-satellite-extras-rpms'.format(distro_id))])
|
||||
+ items=[mock_package('foreman', '{}-8-for-x86_64-satellite-extras-rpms'.format(distro_id)),
|
||||
+ mock_package('foreman-proxy', 'nosuch-{}-8-for-x86_64-satellite-extras-rpms'.format(distro_id))])
|
||||
|
||||
repomap = RepositoriesMapping(
|
||||
- mapping=[RepoMapEntry(source='{0}7-base'.format(distro_id),
|
||||
- target=['{0}8-baseos'.format(distro_id),
|
||||
- '{0}8-appstream'.format(distro_id),
|
||||
- '{0}8-blacklist'.format(distro_id)]),
|
||||
- RepoMapEntry(source='{0}7-satellite-extras'.format(distro_id),
|
||||
- target=['{0}8-satellite-extras'.format(distro_id)])],
|
||||
+ mapping=[RepoMapEntry(source='{0}8-base'.format(distro_id),
|
||||
+ target=['{0}9-baseos'.format(distro_id),
|
||||
+ '{0}9-appstream'.format(distro_id),
|
||||
+ '{0}9-blacklist'.format(distro_id)]),
|
||||
+ RepoMapEntry(source='{0}8-satellite-extras'.format(distro_id),
|
||||
+ target=['{0}9-satellite-extras'.format(distro_id)])],
|
||||
repositories=[
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}7-base'.format(distro_id),
|
||||
- repoid='{0}-7-server-rpms'.format(distro_id),
|
||||
- major_version='7',
|
||||
+ pesid='{0}8-base'.format(distro_id),
|
||||
+ repoid='{0}-8-server-rpms'.format(distro_id),
|
||||
+ major_version='8',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -136,9 +134,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-baseos'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-baseos'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -146,9 +144,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-appstream'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-appstream'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -156,9 +154,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-blacklist'.format(distro_id),
|
||||
- repoid='{0}-8-blacklisted-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-blacklist'.format(distro_id),
|
||||
+ repoid='{0}-9-blacklisted-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -166,9 +164,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}7-satellite-extras'.format(distro_id),
|
||||
- repoid='{0}-7-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
- major_version='7',
|
||||
+ pesid='{0}8-satellite-extras'.format(distro_id),
|
||||
+ repoid='{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
+ major_version='8',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -176,9 +174,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-satellite-extras'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-satellite-extras'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -188,7 +186,7 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
]
|
||||
)
|
||||
|
||||
- repos_blacklisted = RepositoriesBlacklisted(repoids=['{}-8-blacklisted-rpms'.format(distro_id)])
|
||||
+ repos_blacklisted = RepositoriesBlacklisted(repoids=['{}-9-blacklisted-rpms'.format(distro_id)])
|
||||
|
||||
msgs = [facts, repomap, repos_blacklisted, installed_rpms]
|
||||
|
||||
@@ -207,9 +205,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
produced_rhel_repoids = {repo.repoid for repo in rhel_repos}
|
||||
|
||||
expected_repoids = {
|
||||
- "{0}-8-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
- "{0}-8-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
- "{0}-8-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
}
|
||||
|
||||
assert produced_distro_repoids == expected_repoids
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
index 3fcf4aa6..a8e801b9 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
@@ -7,7 +7,6 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import SystemdBrokenSymlinksSource, SystemdBrokenSymlinksTarget, SystemdServicesInfoSource
|
||||
|
||||
_INSTALLATION_CHANGED = {
|
||||
- '8': ['rngd.service', 'sysstat.service'],
|
||||
'9': [],
|
||||
'10': [],
|
||||
}
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
index 5771fc6c..d52abdfa 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
@@ -1,13 +1,8 @@
|
||||
from leapp.libraries.actor import repairsystemdsymlinks
|
||||
from leapp.libraries.common import systemd
|
||||
-from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked
|
||||
-from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import (
|
||||
- SystemdBrokenSymlinksSource,
|
||||
- SystemdBrokenSymlinksTarget,
|
||||
- SystemdServiceFile,
|
||||
- SystemdServicesInfoSource
|
||||
-)
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import SystemdServiceFile, SystemdServicesInfoSource
|
||||
|
||||
|
||||
class MockedSystemdCmd:
|
||||
@@ -20,8 +15,16 @@ class MockedSystemdCmd:
|
||||
|
||||
|
||||
def test_bad_symslinks(monkeypatch):
|
||||
+ # there is no _INSTALLATION_CHANGED service on RHEL 8 and RHEL 9, but it's
|
||||
+ # possible such service will be discovered and added in the future as it
|
||||
+ # was on RHEL 7, so let's add such case
|
||||
+ monkeypatch.setitem(
|
||||
+ repairsystemdsymlinks._INSTALLATION_CHANGED,
|
||||
+ "9", ["some.service"],
|
||||
+ )
|
||||
+
|
||||
service_files = [
|
||||
- SystemdServiceFile(name='rngd.service', state='enabled'),
|
||||
+ SystemdServiceFile(name='some.service', state='enabled'),
|
||||
SystemdServiceFile(name='sysstat.service', state='disabled'),
|
||||
SystemdServiceFile(name='hello.service', state='enabled'),
|
||||
SystemdServiceFile(name='world.service', state='disabled'),
|
||||
@@ -36,11 +39,15 @@ def test_bad_symslinks(monkeypatch):
|
||||
monkeypatch.setattr(systemd, 'reenable_unit', reenable_mocked)
|
||||
|
||||
service_info = SystemdServicesInfoSource(service_files=service_files)
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[service_info]))
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "current_actor",
|
||||
+ CurrentActorMocked(src_ver="8.10", dst_ver="9.6", msgs=[service_info]),
|
||||
+ )
|
||||
|
||||
repairsystemdsymlinks._handle_bad_symlinks(service_info.service_files)
|
||||
|
||||
- assert reenable_mocked.units == ['rngd.service']
|
||||
+ assert reenable_mocked.units == ['some.service']
|
||||
|
||||
|
||||
def test_handle_newly_broken_symlink(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/tests/test_version.py b/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
index d51f8098..f36dbc5f 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
@@ -94,7 +94,7 @@ def test_matches_source_version(monkeypatch, result, version_list):
|
||||
(False, ['8.2', '8.0']),
|
||||
])
|
||||
def test_matches_target_version(monkeypatch, result, version_list):
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(src_ver='7.6'))
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(src_ver='7.6', dst_ver='8.1'))
|
||||
assert version.matches_target_version(*version_list) == result
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/testutils.py b/repos/system_upgrade/common/libraries/testutils.py
|
||||
index e84cc03a..107ad8a7 100644
|
||||
--- a/repos/system_upgrade/common/libraries/testutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/testutils.py
|
||||
@@ -80,7 +80,7 @@ def _make_default_config(actor_config_schema):
|
||||
class CurrentActorMocked: # pylint:disable=R0904
|
||||
def __init__(self, arch=architecture.ARCH_X86_64, envars=None, # pylint:disable=R0913
|
||||
kernel='3.10.0-957.43.1.el7.x86_64',
|
||||
- release_id='rhel', src_ver='7.8', dst_ver='8.1', msgs=None, flavour='default', config=None,
|
||||
+ release_id='rhel', src_ver='8.10', dst_ver='9.6', msgs=None, flavour='default', config=None,
|
||||
virtual_source_version=None, virtual_target_version=None,
|
||||
supported_upgrade_paths=None):
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,303 +0,0 @@
|
||||
From ad9b2ae552b6c36d78a445dbbcfcc179afd1d839 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:23:55 +0200
|
||||
Subject: [PATCH 44/55] scancpu: Remove non-JSON ("txt") lscpu output support
|
||||
|
||||
This was only used on RHEL 7.
|
||||
|
||||
- Remove txt test files
|
||||
- Remove empty_field test - IIRC it's not possible to have and empty
|
||||
field in JSON lscpu output, there would be null
|
||||
---
|
||||
.../actors/scancpu/libraries/scancpu.py | 11 ++---
|
||||
.../scancpu/tests/files/{json => }/invalid | 0
|
||||
.../tests/files/{json => }/lscpu_aarch64 | 0
|
||||
.../tests/files/{json => }/lscpu_ppc64le | 0
|
||||
.../tests/files/{json => }/lscpu_s390x | 0
|
||||
.../tests/files/{json => }/lscpu_x86_64 | 0
|
||||
.../scancpu/tests/files/txt/lscpu_aarch64 | 25 -----------
|
||||
.../scancpu/tests/files/txt/lscpu_empty_field | 4 --
|
||||
.../scancpu/tests/files/txt/lscpu_ppc64le | 15 -------
|
||||
.../scancpu/tests/files/txt/lscpu_s390x | 26 ------------
|
||||
.../scancpu/tests/files/txt/lscpu_x86_64 | 36 ----------------
|
||||
.../actors/scancpu/tests/test_scancpu.py | 42 ++-----------------
|
||||
12 files changed, 7 insertions(+), 152 deletions(-)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/invalid (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_aarch64 (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_ppc64le (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_s390x (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_x86_64 (100%)
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
index db3f92d4..ecc23349 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
@@ -2,17 +2,15 @@ import json
|
||||
import re
|
||||
|
||||
from leapp.libraries.common.config import architecture
|
||||
-from leapp.libraries.common.config.version import get_source_major_version
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import CPUInfo, DetectedDeviceOrDriver, DeviceDriverDeprecationData
|
||||
|
||||
-LSCPU_NAME_VALUE = re.compile(r'^(?P<name>[^:]+):[^\S\n]+(?P<value>.+)\n?', flags=re.MULTILINE)
|
||||
PPC64LE_MODEL = re.compile(r'\d+\.\d+ \(pvr (?P<family>[0-9a-fA-F]+) 0*[0-9a-fA-F]+\)')
|
||||
|
||||
|
||||
-def _get_lscpu_output(output_json=False):
|
||||
+def _get_lscpu_output():
|
||||
try:
|
||||
- result = run(['lscpu'] + (['-J'] if output_json else []))
|
||||
+ result = run(['lscpu', '-J'])
|
||||
return result.get('stdout', '')
|
||||
except (OSError, CalledProcessError):
|
||||
api.current_logger().debug('Executing `lscpu` failed', exc_info=True)
|
||||
@@ -20,10 +18,7 @@ def _get_lscpu_output(output_json=False):
|
||||
|
||||
|
||||
def _parse_lscpu_output():
|
||||
- if get_source_major_version() == '7':
|
||||
- return dict(LSCPU_NAME_VALUE.findall(_get_lscpu_output()))
|
||||
-
|
||||
- lscpu = _get_lscpu_output(output_json=True)
|
||||
+ lscpu = _get_lscpu_output()
|
||||
try:
|
||||
parsed_json = json.loads(lscpu)
|
||||
# The json contains one entry "lscpu" which is a list of dictionaries
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid b/repos/system_upgrade/common/actors/scancpu/tests/files/invalid
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/invalid
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64 b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_x86_64
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_x86_64
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
deleted file mode 100644
|
||||
index 3b9619ef..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-Architecture: aarch64
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 160
|
||||
-On-line CPU(s) list: 0-159
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 80
|
||||
-Socket(s): 2
|
||||
-NUMA node(s): 4
|
||||
-Vendor ID: ARM
|
||||
-BIOS Vendor ID: Ampere(R)
|
||||
-Model: 1
|
||||
-Model name: Neoverse-N1
|
||||
-BIOS Model name: Ampere(R) Altra(R) Processor
|
||||
-Stepping: r3p1
|
||||
-CPU max MHz: 3000.0000
|
||||
-CPU min MHz: 1000.0000
|
||||
-BogoMIPS: 50.00
|
||||
-L1d cache: 64K
|
||||
-L1i cache: 64K
|
||||
-L2 cache: 1024K
|
||||
-NUMA node0 CPU(s): 0-79
|
||||
-NUMA node1 CPU(s): 80-159
|
||||
-NUMA node2 CPU(s):
|
||||
-NUMA node3 CPU(s):
|
||||
-Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
deleted file mode 100644
|
||||
index f830b7fe..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
+++ /dev/null
|
||||
@@ -1,4 +0,0 @@
|
||||
-Empyt 1:
|
||||
-Empyt 2:
|
||||
-Empyt 3:
|
||||
-Flags: flag
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
deleted file mode 100644
|
||||
index 07d2ed65..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
-Architecture: ppc64le
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 8
|
||||
-On-line CPU(s) list: 0-7
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 1
|
||||
-Socket(s): 8
|
||||
-NUMA node(s): 1
|
||||
-Model: 2.1 (pvr 004b 0201)
|
||||
-Model name: POWER8E (raw), altivec supported
|
||||
-Hypervisor vendor: KVM
|
||||
-Virtualization type: para
|
||||
-L1d cache: 64K
|
||||
-L1i cache: 32K
|
||||
-NUMA node0 CPU(s): 0-7
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
deleted file mode 100644
|
||||
index 2c0de9f9..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
+++ /dev/null
|
||||
@@ -1,26 +0,0 @@
|
||||
-Architecture: s390x
|
||||
-CPU op-mode(s): 32-bit, 64-bit
|
||||
-Byte Order: Big Endian
|
||||
-CPU(s): 4
|
||||
-On-line CPU(s) list: 0-3
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 1
|
||||
-Socket(s) per book: 1
|
||||
-Book(s) per drawer: 1
|
||||
-Drawer(s): 4
|
||||
-NUMA node(s): 1
|
||||
-Vendor ID: IBM/S390
|
||||
-Machine type: 3931
|
||||
-CPU dynamic MHz: 5200
|
||||
-CPU static MHz: 5200
|
||||
-BogoMIPS: 3331.00
|
||||
-Hypervisor: KVM/Linux
|
||||
-Hypervisor vendor: KVM
|
||||
-Virtualization type: full
|
||||
-Dispatching mode: horizontal
|
||||
-L1d cache: 128K
|
||||
-L1i cache: 128K
|
||||
-L2 cache: 32768K
|
||||
-L3 cache: 262144K
|
||||
-NUMA node0 CPU(s): 0-3
|
||||
-Flags: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt vxp2 nnpa sie
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64 b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
deleted file mode 100644
|
||||
index a1dc1035..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
+++ /dev/null
|
||||
@@ -1,36 +0,0 @@
|
||||
-Architecture: x86_64
|
||||
-CPU op-mode(s): 32-bit, 64-bit
|
||||
-Address sizes: 46 bits physical, 48 bits virtual
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 48
|
||||
-On-line CPU(s) list: 0-47
|
||||
-Vendor ID: GenuineIntel
|
||||
-Model name: Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz
|
||||
-CPU family: 6
|
||||
-Model: 63
|
||||
-Thread(s) per core: 2
|
||||
-Core(s) per socket: 12
|
||||
-Socket(s): 2
|
||||
-Stepping: 2
|
||||
-CPU(s) scaling MHz: 44%
|
||||
-CPU max MHz: 3100.0000
|
||||
-CPU min MHz: 1200.0000
|
||||
-BogoMIPS: 4599.83
|
||||
-Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d
|
||||
-Virtualization: VT-x
|
||||
-L1d cache: 768 KiB (24 instances)
|
||||
-L1i cache: 768 KiB (24 instances)
|
||||
-L2 cache: 6 MiB (24 instances)
|
||||
-L3 cache: 60 MiB (2 instances)
|
||||
-NUMA node(s): 2
|
||||
-NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46
|
||||
-NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47
|
||||
-Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
|
||||
-Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
|
||||
-Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
|
||||
-Vulnerability Meltdown: Mitigation; PTI
|
||||
-Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
|
||||
-Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
|
||||
-Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
|
||||
-Vulnerability Srbds: Not affected
|
||||
-Vulnerability Tsx async abort: Not affected
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
index be0802ba..3605ebe7 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
@@ -61,29 +61,20 @@ class mocked_get_cpuinfo:
|
||||
def __init__(self, filename):
|
||||
self.filename = filename
|
||||
|
||||
- def __call__(self, output_json=False):
|
||||
+ def __call__(self):
|
||||
"""
|
||||
Return lines of the self.filename test file located in the files directory.
|
||||
|
||||
Those files contain /proc/cpuinfo content from several machines.
|
||||
"""
|
||||
-
|
||||
- filename = self.filename
|
||||
- if output_json:
|
||||
- filename = os.path.join('json', filename)
|
||||
- else:
|
||||
- filename = os.path.join('txt', filename)
|
||||
- filename = os.path.join(CUR_DIR, 'files', filename)
|
||||
+ filename = os.path.join(CUR_DIR, 'files', self.filename)
|
||||
|
||||
with open(filename, 'r') as fp:
|
||||
return '\n'.join(fp.read().splitlines())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("arch", ARCH_SUPPORTED)
|
||||
-@pytest.mark.parametrize("version", ['7', '8'])
|
||||
-def test_scancpu(monkeypatch, arch, version):
|
||||
-
|
||||
- monkeypatch.setattr('leapp.libraries.actor.scancpu.get_source_major_version', lambda: version)
|
||||
+def test_scancpu(monkeypatch, arch):
|
||||
|
||||
mocked_cpuinfo = mocked_get_cpuinfo('lscpu_' + arch)
|
||||
monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
@@ -106,34 +97,9 @@ def test_scancpu(monkeypatch, arch, version):
|
||||
assert expected == produced
|
||||
|
||||
|
||||
-def test_lscpu_with_empty_field(monkeypatch):
|
||||
-
|
||||
- def mocked_cpuinfo(*args, **kwargs):
|
||||
- return mocked_get_cpuinfo('lscpu_empty_field')(output_json=False)
|
||||
-
|
||||
- monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
- monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- current_actor = CurrentActorMocked()
|
||||
- monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
-
|
||||
- scancpu.process()
|
||||
-
|
||||
- expected = CPUInfo(machine_type=None, flags=['flag'])
|
||||
- produced = api.produce.model_instances[0]
|
||||
-
|
||||
- assert api.produce.called == 1
|
||||
-
|
||||
- assert expected.machine_type == produced.machine_type
|
||||
- assert sorted(expected.flags) == sorted(produced.flags)
|
||||
-
|
||||
-
|
||||
def test_parse_invalid_json(monkeypatch):
|
||||
|
||||
- monkeypatch.setattr('leapp.libraries.actor.scancpu.get_source_major_version', lambda: '8')
|
||||
-
|
||||
- def mocked_cpuinfo(*args, **kwargs):
|
||||
- return mocked_get_cpuinfo('invalid')(output_json=True)
|
||||
-
|
||||
+ mocked_cpuinfo = mocked_get_cpuinfo('invalid')
|
||||
monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
From 44c6b10a1813bfa019fb8ee2ec08a619e325ba08 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:34:37 +0200
|
||||
Subject: [PATCH 45/55] modify_userspace_for_livemode: Remove RHEL7
|
||||
crypto-policies workaround
|
||||
|
||||
---
|
||||
.../libraries/prepareliveimage.py | 13 -------------
|
||||
.../tests/test_livemode_userspace_modifications.py | 2 --
|
||||
2 files changed, 15 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
index 686c4cd6..116c463d 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
@@ -381,19 +381,6 @@ def setup_sshd(context, authorized_keys):
|
||||
error
|
||||
)
|
||||
|
||||
- # @Todo(mhecko): This is hazardous. I guess we are setting this so that we can use weaker SSH keys from RHEL7,
|
||||
- # # but this way we change crypto settings system-wise (could be a problem for FIPS). Instead, we
|
||||
- # # should check whether the keys will be OK on RHEL8, and inform the user otherwise.
|
||||
- if get_target_major_version() == '8': # set to LEGACY for 7>8 only
|
||||
- try:
|
||||
- with context.open('/etc/crypto-policies/config', 'w+') as f:
|
||||
- f.write('LEGACY\n')
|
||||
- except OSError as error:
|
||||
- api.current_logger().warning('Cannot set crypto policy to LEGACY')
|
||||
- details = {'details': 'Failed to set crypto-policies to LEGACY due to the error: {0}'.format(error)}
|
||||
- raise StopActorExecutionError('Failed to set up livemode SSHD', details=details)
|
||||
-
|
||||
-
|
||||
# stolen from upgradeinitramfsgenerator.py
|
||||
def _get_target_kernel_version(context):
|
||||
"""
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
index e890f45a..b046d8c7 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
@@ -296,8 +296,6 @@ def test_setup_sshd(monkeypatch):
|
||||
Action(type_=ActionType.SYMLINK,
|
||||
args=('/usr/lib/systemd/system/sshd.service',
|
||||
'/USERSPACE/etc/systemd/system/multi-user.target.wants/sshd.service')),
|
||||
- Action(type_=ActionType.OPEN, args=('/USERSPACE/etc/crypto-policies/config',)),
|
||||
- Action(type_=ActionType.WRITE, args=('LEGACY\n',)),
|
||||
]
|
||||
|
||||
error = assert_execution_trace_subsumes_other(actual_trace, expected_trace)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
From 4bede4b415f3e561399bf5c4ebed659c1aa4948d Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:37:41 +0200
|
||||
Subject: [PATCH 46/55] modify_userspace_for_livemode: Remove unused code in
|
||||
modify_userspace_for_livemode
|
||||
|
||||
---
|
||||
.../libraries/prepareliveimage.py | 30 +------------------
|
||||
1 file changed, 1 insertion(+), 29 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
index 116c463d..2587bf89 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
@@ -6,7 +6,7 @@ import os.path
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
-from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.libraries.stdlib import api
|
||||
from leapp.models import LiveImagePreparationInfo
|
||||
|
||||
LEAPP_UPGRADE_SERVICE_FILE = 'upgrade.service'
|
||||
@@ -381,34 +381,6 @@ def setup_sshd(context, authorized_keys):
|
||||
error
|
||||
)
|
||||
|
||||
-# stolen from upgradeinitramfsgenerator.py
|
||||
-def _get_target_kernel_version(context):
|
||||
- """
|
||||
- Get the version of the most recent kernel version within the container.
|
||||
- """
|
||||
- try:
|
||||
- results = context.call(['rpm', '-qa', 'kernel-core'], split=True)['stdout']
|
||||
-
|
||||
- except CalledProcessError as error:
|
||||
- problem = 'Could not query the target userspace kernel version through rpm. Full error: {0}'.format(error)
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot get the version of the installed kernel.',
|
||||
- details={'Problem': problem})
|
||||
-
|
||||
- if len(results) > 1:
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot detect the version of the target userspace kernel.',
|
||||
- details={'Problem': 'Detected unexpectedly multiple kernels inside target userspace container.'})
|
||||
- if not results:
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot detect the version of the target userspace kernel.',
|
||||
- details={'Problem': 'An rpm query for the available kernels did not produce any results.'})
|
||||
-
|
||||
- kernel_version = '-'.join(results[0].rsplit("-", 2)[-2:])
|
||||
- api.current_logger().debug('Detected kernel version inside container: {}.'.format(kernel_version))
|
||||
-
|
||||
- return kernel_version
|
||||
-
|
||||
|
||||
def fakerootfs():
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,170 +0,0 @@
|
||||
From 000c5f6558e788842fbf95d2fdb0014d18285c15 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 15:10:58 +0200
|
||||
Subject: [PATCH 47/55] repositoriesblacklist: Remove the rhel7-optional
|
||||
unsupported PESID
|
||||
|
||||
Update tests to assume 8->9 upgrade path.
|
||||
---
|
||||
.../libraries/repositoriesblacklist.py | 4 +-
|
||||
.../tests/test_repositoriesblacklist.py | 48 ++++++++++---------
|
||||
2 files changed, 27 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py b/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
index e22fbee0..5059f619 100644
|
||||
--- a/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
+++ b/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
@@ -6,7 +6,6 @@ from leapp.models import CustomTargetRepository, RepositoriesBlacklisted, Reposi
|
||||
|
||||
# {OS_MAJOR_VERSION: PESID}
|
||||
UNSUPPORTED_PESIDS = {
|
||||
- "7": "rhel7-optional",
|
||||
"8": "rhel8-CRB",
|
||||
"9": "rhel9-CRB",
|
||||
"10": "rhel10-CRB"
|
||||
@@ -28,9 +27,8 @@ def _report_using_unsupported_repos(repos):
|
||||
|
||||
|
||||
def _report_excluded_repos(repos):
|
||||
- optional_repository_name = 'optional' if get_source_major_version() == '7' else 'CRB'
|
||||
api.current_logger().info(
|
||||
- "The {0} repository is not enabled. Excluding {1} from the upgrade".format(optional_repository_name, repos)
|
||||
+ "The CRB repository is not enabled. Excluding {} from the upgrade".format(repos)
|
||||
)
|
||||
|
||||
report = [
|
||||
diff --git a/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py b/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
index c4f9a36e..945007c6 100644
|
||||
--- a/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
+++ b/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
@@ -20,8 +20,8 @@ from leapp.models import (
|
||||
def repofacts_opts_disabled():
|
||||
repos_data = [
|
||||
RepositoryData(
|
||||
- repoid="rhel-7-server-optional-rpms",
|
||||
- name="RHEL 7 Server",
|
||||
+ repoid="codeready-builder-for-rhel-8-x86_64-rpms",
|
||||
+ name="RHEL 8 CRB",
|
||||
enabled=False,
|
||||
)
|
||||
]
|
||||
@@ -32,11 +32,11 @@ def repofacts_opts_disabled():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def rhel7_optional_pesidrepo():
|
||||
+def rhel8_crb_pesidrepo():
|
||||
return PESIDRepositoryEntry(
|
||||
- pesid='rhel7-optional',
|
||||
- major_version='7',
|
||||
- repoid='rhel-7-server-optional-rpms',
|
||||
+ pesid='rhel8-CRB',
|
||||
+ major_version='8',
|
||||
+ repoid='codeready-builder-for-rhel-8-x86_64-rpms',
|
||||
rhui='',
|
||||
arch='x86_64',
|
||||
channel='ga',
|
||||
@@ -46,11 +46,11 @@ def rhel7_optional_pesidrepo():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def rhel8_crb_pesidrepo():
|
||||
+def rhel9_crb_pesidrepo():
|
||||
return PESIDRepositoryEntry(
|
||||
- pesid='rhel8-CRB',
|
||||
- major_version='8',
|
||||
- repoid='codeready-builder-for-rhel-8-x86_64-rpms',
|
||||
+ pesid='rhel9-CRB',
|
||||
+ major_version='9',
|
||||
+ repoid='codeready-builder-for-rhel-9-x86_64-rpms',
|
||||
rhui='',
|
||||
arch='x86_64',
|
||||
channel='ga',
|
||||
@@ -60,10 +60,10 @@ def rhel8_crb_pesidrepo():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def repomap_opts_only(rhel7_optional_pesidrepo, rhel8_crb_pesidrepo):
|
||||
+def repomap_opts_only(rhel8_crb_pesidrepo, rhel9_crb_pesidrepo):
|
||||
return RepositoriesMapping(
|
||||
- mapping=[RepoMapEntry(source='rhel7-optional', target=['rhel8-CRB'])],
|
||||
- repositories=[rhel7_optional_pesidrepo, rhel8_crb_pesidrepo]
|
||||
+ mapping=[RepoMapEntry(source='rhel8-CRB', target=['rhel9-CRB'])],
|
||||
+ repositories=[rhel8_crb_pesidrepo, rhel9_crb_pesidrepo]
|
||||
)
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ def test_all_target_optionals_blacklisted_when_no_optional_on_source(monkeypatch
|
||||
|
||||
repos_data = [
|
||||
RepositoryData(
|
||||
- repoid="rhel-7-server-rpms",
|
||||
- name="RHEL 7 Server",
|
||||
+ repoid="rhel-8-server-rpms",
|
||||
+ name="RHEL 8 Server",
|
||||
enabled=True,
|
||||
)
|
||||
]
|
||||
@@ -92,7 +92,7 @@ def test_all_target_optionals_blacklisted_when_no_optional_on_source(monkeypatch
|
||||
repositoriesblacklist.process()
|
||||
|
||||
assert api.produce.called
|
||||
- assert 'codeready-builder-for-rhel-8-x86_64-rpms' in api.produce.model_instances[0].repoids
|
||||
+ assert 'codeready-builder-for-rhel-9-x86_64-rpms' in api.produce.model_instances[0].repoids
|
||||
|
||||
|
||||
def test_with_no_mapping_for_optional_repos(monkeypatch, repomap_opts_only, repofacts_opts_disabled):
|
||||
@@ -115,7 +115,11 @@ def test_blacklist_produced_when_optional_repo_disabled(monkeypatch, repofacts_o
|
||||
Tests whether a correct blacklist is generated when there is disabled optional repo on the system.
|
||||
"""
|
||||
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[repofacts_opts_disabled, repomap_opts_only]))
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "current_actor",
|
||||
+ CurrentActorMocked(msgs=[repofacts_opts_disabled, repomap_opts_only]),
|
||||
+ )
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
monkeypatch.setattr(reporting, "create_report", produce_mocked())
|
||||
|
||||
@@ -123,7 +127,7 @@ def test_blacklist_produced_when_optional_repo_disabled(monkeypatch, repofacts_o
|
||||
|
||||
assert api.produce.model_instances, 'A blacklist should get generated.'
|
||||
|
||||
- expected_blacklisted_repoid = 'codeready-builder-for-rhel-8-x86_64-rpms'
|
||||
+ expected_blacklisted_repoid = 'codeready-builder-for-rhel-9-x86_64-rpms'
|
||||
err_msg = 'Blacklist does not contain expected repoid.'
|
||||
assert expected_blacklisted_repoid in api.produce.model_instances[0].repoids, err_msg
|
||||
|
||||
@@ -166,8 +170,8 @@ def test_repositoriesblacklist_not_empty(monkeypatch, repofacts_opts_disabled, r
|
||||
|
||||
def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repomap_opts_only):
|
||||
"""
|
||||
- Tests whether nothing is produced if there are some disabled optional repos, but an empty blacklist is determined
|
||||
- from the repo mapping data.
|
||||
+ Tests whether nothing is produced if there are some disabled optional
|
||||
+ repos, but an empty blacklist is determined from the repo mapping data.
|
||||
"""
|
||||
|
||||
msgs_to_feed = [repofacts_opts_disabled, repomap_opts_only]
|
||||
@@ -177,7 +181,7 @@ def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repom
|
||||
repositoriesblacklist,
|
||||
"_get_repoids_to_exclude",
|
||||
lambda dummy_mapping: set()
|
||||
- ) # pylint:disable=W0108
|
||||
+ )
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
|
||||
repositoriesblacklist.process()
|
||||
@@ -187,7 +191,7 @@ def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repom
|
||||
@pytest.mark.parametrize(
|
||||
("enabled_repo", "exp_report_title", "message_produced"),
|
||||
[
|
||||
- ("codeready-builder-for-rhel-8-x86_64-rpms", "Using repository not supported by Red Hat", False),
|
||||
+ ("codeready-builder-for-rhel-9-x86_64-rpms", "Using repository not supported by Red Hat", False),
|
||||
("some_other_enabled_repo", "Excluded target system repositories", True),
|
||||
(None, "Excluded target system repositories", True),
|
||||
],
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,209 +0,0 @@
|
||||
From 0a203330cee4fba6a28c65f1c6e0e450cc45771e Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Thu, 30 Oct 2025 11:52:39 +0100
|
||||
Subject: [PATCH 48/55] mount_unit_gen: bind mount /sysroot/boot to /boot
|
||||
|
||||
Our changes towards using systemd-fstab-generator in the upgrade
|
||||
initramfs caused that we are mounting almost all partitions, including
|
||||
/boot (the actual mount target is /sysroot/boot) early in the boot
|
||||
process. When upgrading with FIPS, the dracut fips module tries to mount
|
||||
the device where the boot partition resides to check the integrity of
|
||||
the kernel, however, it fails as the boot block device is already
|
||||
mounted by us. This patch therefore introduces a static unit that
|
||||
bind-mounts What=/sysroot/boot to Where=/boot, making the contents of
|
||||
/boot available to the fips module. The bind-mounting service is
|
||||
introduced only if the source system has /boot on a separate partition.
|
||||
This is determined by checking whether anything shuld be mounted at
|
||||
/boot according to fstab.
|
||||
|
||||
Jira-ref: RHEL-123886
|
||||
---
|
||||
.../initramfs/mount_units_generator/actor.py | 3 +-
|
||||
.../files/bundled_units/boot.mount | 11 ++++
|
||||
.../libraries/mount_unit_generator.py | 38 ++++++++++-
|
||||
.../tests/test_mount_unit_generation.py | 63 ++++++++++++++++++-
|
||||
4 files changed, 111 insertions(+), 4 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
index dd667513..23c618b6 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -1,6 +1,6 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
-from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ class MountUnitGenerator(Actor):
|
||||
consumes = (
|
||||
LiveModeConfig,
|
||||
TargetUserSpaceInfo,
|
||||
+ StorageInfo,
|
||||
)
|
||||
produces = (
|
||||
UpgradeInitramfsTasks,
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
new file mode 100644
|
||||
index 00000000..869c5e4c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
@@ -0,0 +1,11 @@
|
||||
+[Unit]
|
||||
+DefaultDependencies=no
|
||||
+Before=local-fs.target
|
||||
+After=sysroot-boot.target
|
||||
+Requires=sysroot-boot.target
|
||||
+
|
||||
+[Mount]
|
||||
+What=/sysroot/boot
|
||||
+Where=/boot
|
||||
+Type=none
|
||||
+Options=bind
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
index 943bddd4..e3070986 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -5,7 +5,9 @@ import tempfile
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+BIND_MOUNT_SYSROOT_BOOT_UNIT = 'boot.mount'
|
||||
|
||||
|
||||
def run_systemd_fstab_generator(output_directory):
|
||||
@@ -294,6 +296,39 @@ def request_units_inclusion_in_initramfs(files_to_include):
|
||||
api.produce(tasks)
|
||||
|
||||
|
||||
+def does_system_have_separate_boot_partition():
|
||||
+ storage_info = next(api.consume(StorageInfo), None)
|
||||
+ if not storage_info:
|
||||
+ err_msg = 'Actor did not receive required information about system storage (StorageInfo)'
|
||||
+ raise StopActorExecutionError(err_msg)
|
||||
+
|
||||
+ for fstab_entry in storage_info.fstab:
|
||||
+ if fstab_entry.fs_file == '/boot':
|
||||
+ return True
|
||||
+
|
||||
+ return False
|
||||
+
|
||||
+
|
||||
+def inject_bundled_units(workspace):
|
||||
+ """
|
||||
+ Copy static units that are bundled within this actor into the workspace.
|
||||
+ """
|
||||
+ bundled_units_dir = api.get_actor_folder_path('bundled_units')
|
||||
+ for unit in os.listdir(bundled_units_dir):
|
||||
+ if unit == BIND_MOUNT_SYSROOT_BOOT_UNIT:
|
||||
+ has_separate_boot = does_system_have_separate_boot_partition()
|
||||
+ if not has_separate_boot:
|
||||
+ # We perform bind-mounting because of dracut's fips module.
|
||||
+ # When /boot is not a separate partition, we don't need to bind mount it --
|
||||
+ # the fips module itself will create a symlink.
|
||||
+ continue
|
||||
+
|
||||
+ unit_path = os.path.join(bundled_units_dir, unit)
|
||||
+ unit_dst = os.path.join(workspace, unit)
|
||||
+ api.current_logger().debug('Copying static unit bundled within leapp {} to {}'.format(unit, unit_dst))
|
||||
+ shutil.copyfile(unit_path, unit_dst)
|
||||
+
|
||||
+
|
||||
def setup_storage_initialization():
|
||||
livemode_config = next(api.consume(LiveModeConfig), None)
|
||||
if livemode_config and livemode_config.is_enabled:
|
||||
@@ -306,6 +341,7 @@ def setup_storage_initialization():
|
||||
run_systemd_fstab_generator(workspace_path)
|
||||
remove_units_for_targets_that_are_already_mounted_by_dracut(workspace_path)
|
||||
prefix_all_mount_units_with_sysroot(workspace_path)
|
||||
+ inject_bundled_units(workspace_path)
|
||||
fix_symlinks_in_targets(workspace_path)
|
||||
mount_unit_files = copy_units_into_system_location(upgrade_container_ctx, workspace_path)
|
||||
request_units_inclusion_in_initramfs(mount_unit_files)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index 8849ada9..eb90a75d 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -5,9 +5,9 @@ import pytest
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.actor import mount_unit_generator
|
||||
-from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked
|
||||
from leapp.libraries.stdlib import api, CalledProcessError
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import FstabEntry, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
|
||||
|
||||
def test_run_systemd_fstab_generator_successful_generation(monkeypatch):
|
||||
@@ -267,3 +267,62 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
]
|
||||
assert sorted(files) == sorted(expected_files)
|
||||
assert mount_unit_generator._delete_file.removal_called
|
||||
+
|
||||
+
|
||||
+class CurrentActorMockedWithActorFolder(CurrentActorMocked):
|
||||
+ def __init__(self, actor_folder_path, *args, **kwargs):
|
||||
+ self.actor_folder_path = actor_folder_path
|
||||
+ super().__init__(*args, **kwargs)
|
||||
+
|
||||
+ def get_actor_folder_path(self, subfolder):
|
||||
+ return os.path.join(self.actor_folder_path, subfolder)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('has_separate_boot', (True, False))
|
||||
+def test_injection_of_sysroot_boot_bindmount_unit(monkeypatch, has_separate_boot):
|
||||
+ fstab_entries = [
|
||||
+ FstabEntry(fs_spec='UUID=123', fs_file='/root', fs_vfstype='xfs',
|
||||
+ fs_mntops='defaults', fs_freq='0', fs_passno='0')
|
||||
+ ]
|
||||
+
|
||||
+ if has_separate_boot:
|
||||
+ boot_fstab_entry = FstabEntry(fs_spec='UUID=123', fs_file='/root', fs_vfstype='xfs',
|
||||
+ fs_mntops='defaults', fs_freq='0', fs_passno='0')
|
||||
+ fstab_entries.append(boot_fstab_entry)
|
||||
+
|
||||
+ storage_info = StorageInfo(fstab=fstab_entries)
|
||||
+
|
||||
+ actor_mock = CurrentActorMockedWithActorFolder(actor_folder_path='/actor', msgs=[storage_info])
|
||||
+ monkeypatch.setattr(api, 'current_actor', actor_mock)
|
||||
+
|
||||
+ workspace_path = '/workspace'
|
||||
+ was_copyfile_for_sysroot_boot_called = False
|
||||
+
|
||||
+ def copyfile_mocked(source, dest, *args, **kwargs):
|
||||
+ if not os.path.basename(source) == mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT:
|
||||
+ return
|
||||
+
|
||||
+ assert has_separate_boot
|
||||
+ assert dest == os.path.join(workspace_path, mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT)
|
||||
+
|
||||
+ nonlocal was_copyfile_for_sysroot_boot_called
|
||||
+ was_copyfile_for_sysroot_boot_called = True
|
||||
+
|
||||
+ monkeypatch.setattr(shutil, 'copyfile', copyfile_mocked)
|
||||
+
|
||||
+ def listdir_mocked(path):
|
||||
+ assert path == actor_mock.get_actor_folder_path('bundled_units')
|
||||
+ return [
|
||||
+ mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT,
|
||||
+ 'other.mount'
|
||||
+ ]
|
||||
+
|
||||
+ monkeypatch.setattr(os, 'listdir', listdir_mocked)
|
||||
+ monkeypatch.setattr(mount_unit_generator,
|
||||
+ 'does_system_have_separate_boot_partition',
|
||||
+ lambda: has_separate_boot)
|
||||
+
|
||||
+ mount_unit_generator.inject_bundled_units(workspace_path)
|
||||
+
|
||||
+ if has_separate_boot:
|
||||
+ assert was_copyfile_for_sysroot_boot_called
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
From 9b06998b2077d0007da818059d5c6e244ac55948 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 10 Nov 2025 19:31:25 +0100
|
||||
Subject: [PATCH 49/55] fix parsing of dnf config dump
|
||||
|
||||
This patch fixes handling of empty lines during parsing of output from
|
||||
`dnf config-manager --dump` command.
|
||||
|
||||
Jira: RHEL-120328
|
||||
---
|
||||
repos/system_upgrade/common/libraries/dnfconfig.py | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/dnfconfig.py b/repos/system_upgrade/common/libraries/dnfconfig.py
|
||||
index 4b5afeb5..9f1902b6 100644
|
||||
--- a/repos/system_upgrade/common/libraries/dnfconfig.py
|
||||
+++ b/repos/system_upgrade/common/libraries/dnfconfig.py
|
||||
@@ -43,8 +43,11 @@ def _get_main_dump(context, disable_plugins):
|
||||
|
||||
output_data = {}
|
||||
for line in data[main_start:]:
|
||||
+ if not line.strip():
|
||||
+ continue
|
||||
try:
|
||||
key, val = _strip_split(line, '=', 1)
|
||||
+ output_data[key] = val
|
||||
except ValueError:
|
||||
# This is not expected to happen, but call it a seatbelt in case
|
||||
# the dnf dump implementation will change and we will miss it
|
||||
@@ -54,7 +57,6 @@ def _get_main_dump(context, disable_plugins):
|
||||
api.current_logger().warning(
|
||||
'Cannot parse the dnf dump correctly, line: {}'.format(line))
|
||||
pass
|
||||
- output_data[key] = val
|
||||
|
||||
return output_data
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,609 +0,0 @@
|
||||
From 428c46051619a570b08189677bb27eedf69c2a9e Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 16:06:15 +0200
|
||||
Subject: [PATCH 50/55] Add detection for third-party target Python modules
|
||||
|
||||
Introduce actors to detect presence of third-party
|
||||
Python modules installed for target Python. Those modules could
|
||||
interfere with the upgrade process or cause issues after rebooting
|
||||
into the target system.
|
||||
|
||||
Scanner (scanthirdpartytargetpythonmodules):
|
||||
- Identifies the target Python interpreter
|
||||
- Queries the target Python's sys.path to determine where it searches
|
||||
for modules
|
||||
- Recursively scans these directories for Python files (.py, .so, .pyc)
|
||||
- Cross-references found files against the RPM database to determine
|
||||
ownership and categorize them
|
||||
|
||||
Checker (checkthirdpartytargetpythonmodules) creates a high severity
|
||||
report to inform users about findings and presents full list of them
|
||||
in logs and short version in report.
|
||||
|
||||
Jira: RHEL-71882
|
||||
---
|
||||
.../actor.py | 21 ++
|
||||
.../checkthirdpartytargetpythonmodules.py | 74 +++++++
|
||||
...check_third_party_target_python_modules.py | 46 +++++
|
||||
.../actor.py | 19 ++
|
||||
.../scanthirdpartytargetpythonmodules.py | 193 ++++++++++++++++++
|
||||
..._scan_third_party_target_python_modules.py | 136 ++++++++++++
|
||||
.../models/thirdpartytagetpythonmodules.py | 25 +++
|
||||
requirements.txt | 1 +
|
||||
8 files changed, 515 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/libraries/checkthirdpartytargetpythonmodules.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/tests/test_check_third_party_target_python_modules.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/libraries/scanthirdpartytargetpythonmodules.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/tests/test_scan_third_party_target_python_modules.py
|
||||
create mode 100644 repos/system_upgrade/common/models/thirdpartytagetpythonmodules.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/actor.py b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..e1868819
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/actor.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.checkthirdpartytargetpythonmodules import perform_check
|
||||
+from leapp.models import ThirdPartyTargetPythonModules
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class CheckThirdPartyTargetPythonModules(Actor):
|
||||
+ """
|
||||
+ Produces a report if any third-party target Python modules are detected on the source system.
|
||||
+
|
||||
+ If such modules are detected, a high risk report is produced.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_third_party_target_python_modules'
|
||||
+ consumes = (ThirdPartyTargetPythonModules,)
|
||||
+ produces = (Report,)
|
||||
+ tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ perform_check()
|
||||
diff --git a/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/libraries/checkthirdpartytargetpythonmodules.py b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/libraries/checkthirdpartytargetpythonmodules.py
|
||||
new file mode 100644
|
||||
index 00000000..7ed34738
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/libraries/checkthirdpartytargetpythonmodules.py
|
||||
@@ -0,0 +1,74 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import ThirdPartyTargetPythonModules
|
||||
+
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
+MAX_REPORTED_ITEMS = 30
|
||||
+
|
||||
+
|
||||
+def _formatted_list_output_with_max_items(input_list, sep=FMT_LIST_SEPARATOR, max_items=MAX_REPORTED_ITEMS):
|
||||
+ if not input_list:
|
||||
+ return ''
|
||||
+
|
||||
+ total_count = len(input_list)
|
||||
+ items_to_show = input_list[:max_items]
|
||||
+ formatted = ['{}{}'.format(sep, item) for item in items_to_show]
|
||||
+
|
||||
+ if total_count > max_items:
|
||||
+ formatted.append('{}... and {} more'.format(sep, total_count - max_items))
|
||||
+
|
||||
+ return ''.join(formatted)
|
||||
+
|
||||
+
|
||||
+def check_third_party_target_python_modules(third_party_target_python_modules):
|
||||
+ """Create an inhibitor when third-party Python modules are detected."""
|
||||
+ target_python_version = third_party_target_python_modules.target_python.split('python')[1]
|
||||
+ third_party_rpms = third_party_target_python_modules.third_party_rpm_names
|
||||
+ third_party_modules = third_party_target_python_modules.third_party_modules
|
||||
+
|
||||
+ summary = (
|
||||
+ 'Third-party target Python modules may interfere with '
|
||||
+ 'the upgrade process or cause unexpected behavior after the upgrade.'
|
||||
+ )
|
||||
+
|
||||
+ if third_party_rpms:
|
||||
+ summary = (
|
||||
+ '{pre}\n\nNon-distribution RPM packages detected:{rpmlist}'
|
||||
+ .format(
|
||||
+ pre=summary,
|
||||
+ rpmlist=_formatted_list_output_with_max_items(third_party_rpms))
|
||||
+ )
|
||||
+
|
||||
+ if third_party_modules:
|
||||
+ summary = (
|
||||
+ '{pre}\n\nNon-distribution modules detected (list can be incomplete):{modulelist}'
|
||||
+ .format(
|
||||
+ pre=summary,
|
||||
+ modulelist=_formatted_list_output_with_max_items(third_party_modules))
|
||||
+ )
|
||||
+
|
||||
+ reporting.create_report([
|
||||
+ reporting.Title('Detected third-party Python modules for the target Python version'),
|
||||
+ reporting.Summary(summary),
|
||||
+ reporting.Remediation(
|
||||
+ hint='Remove third-party target Python {} packages before attempting the upgrade or ensure '
|
||||
+ 'that those modules are not interfering with distribution-provided modules.'
|
||||
+ .format(target_python_version),
|
||||
+ ),
|
||||
+ reporting.Severity(reporting.Severity.HIGH)
|
||||
+ ])
|
||||
+
|
||||
+
|
||||
+def perform_check():
|
||||
+ """Perform the check for third-party Python modules."""
|
||||
+ third_party_target_python_modules_msg = next(api.consume(
|
||||
+ ThirdPartyTargetPythonModules),
|
||||
+ None,
|
||||
+ )
|
||||
+
|
||||
+ if not third_party_target_python_modules_msg:
|
||||
+ return
|
||||
+
|
||||
+ if (third_party_target_python_modules_msg.third_party_rpm_names or
|
||||
+ third_party_target_python_modules_msg.third_party_modules):
|
||||
+ check_third_party_target_python_modules(third_party_target_python_modules_msg)
|
||||
diff --git a/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/tests/test_check_third_party_target_python_modules.py b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/tests/test_check_third_party_target_python_modules.py
|
||||
new file mode 100644
|
||||
index 00000000..2a87d195
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/tests/test_check_third_party_target_python_modules.py
|
||||
@@ -0,0 +1,46 @@
|
||||
+import pytest
|
||||
+
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.actor import checkthirdpartytargetpythonmodules
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import ThirdPartyTargetPythonModules
|
||||
+
|
||||
+
|
||||
+def test_perform_check_no_message_available(monkeypatch):
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ checkthirdpartytargetpythonmodules.perform_check()
|
||||
+
|
||||
+ assert not reporting.create_report.called
|
||||
+
|
||||
+
|
||||
+def test_perform_check_empty_lists(monkeypatch):
|
||||
+ msg = ThirdPartyTargetPythonModules(
|
||||
+ target_python='python3.9',
|
||||
+ third_party_modules=[],
|
||||
+ third_party_rpm_names=[]
|
||||
+ )
|
||||
+
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[msg]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ checkthirdpartytargetpythonmodules.perform_check()
|
||||
+
|
||||
+ assert not reporting.create_report.called
|
||||
+
|
||||
+
|
||||
+def test_perform_check_with_third_party_modules(monkeypatch):
|
||||
+ msg = ThirdPartyTargetPythonModules(
|
||||
+ target_python='python3.9',
|
||||
+ third_party_modules=['third_party_module'],
|
||||
+ third_party_rpm_names=['third_party_rpm']
|
||||
+ )
|
||||
+
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[msg]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ checkthirdpartytargetpythonmodules.perform_check()
|
||||
+
|
||||
+ assert reporting.create_report.called
|
||||
diff --git a/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/actor.py b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..2c0d1973
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/actor.py
|
||||
@@ -0,0 +1,19 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import scanthirdpartytargetpythonmodules
|
||||
+from leapp.models import DistributionSignedRPM, ThirdPartyTargetPythonModules
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class ScanThirdPartyTargetPythonModules(Actor):
|
||||
+ """
|
||||
+ Detect third-party target Python modules and RPMs on the source system.
|
||||
+
|
||||
+ """
|
||||
+
|
||||
+ name = 'scan_third_party_target_python_modules'
|
||||
+ consumes = (DistributionSignedRPM,)
|
||||
+ produces = (ThirdPartyTargetPythonModules,)
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ scanthirdpartytargetpythonmodules.process()
|
||||
diff --git a/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/libraries/scanthirdpartytargetpythonmodules.py b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/libraries/scanthirdpartytargetpythonmodules.py
|
||||
new file mode 100644
|
||||
index 00000000..1329c50f
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/libraries/scanthirdpartytargetpythonmodules.py
|
||||
@@ -0,0 +1,193 @@
|
||||
+import json
|
||||
+import os
|
||||
+from collections import defaultdict
|
||||
+from pathlib import Path
|
||||
+
|
||||
+import rpm
|
||||
+
|
||||
+from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api, run
|
||||
+from leapp.models import DistributionSignedRPM, ThirdPartyTargetPythonModules
|
||||
+
|
||||
+PYTHON_EXTENSIONS = (".py", ".so", ".pyc")
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
+
|
||||
+
|
||||
+def _formatted_list_output(input_list, sep=FMT_LIST_SEPARATOR):
|
||||
+ return ['{}{}'.format(sep, item) for item in input_list]
|
||||
+
|
||||
+
|
||||
+def get_python_sys_paths(python_interpreter):
|
||||
+ """Get sys.path from the specified Python interpreter."""
|
||||
+
|
||||
+ result = run([python_interpreter, '-c', 'import sys, json; print(json.dumps(sys.path))'])['stdout']
|
||||
+ raw_paths = json.loads(result)
|
||||
+ paths = [Path(raw_path).resolve() for raw_path in raw_paths]
|
||||
+ return paths
|
||||
+
|
||||
+
|
||||
+def get_python_binary_for_rhel(rhel_version):
|
||||
+ """
|
||||
+ Maps RHEL major version to the appropriate Python binary.
|
||||
+ """
|
||||
+
|
||||
+ version_map = {
|
||||
+ '9': 'python3.9',
|
||||
+ '10': 'python3.12',
|
||||
+ }
|
||||
+ return version_map.get(rhel_version)
|
||||
+
|
||||
+
|
||||
+def is_target_python_present(target_python):
|
||||
+ """
|
||||
+ Checks if the target Python interpreter is available on the system.
|
||||
+ """
|
||||
+
|
||||
+ result = run(['command', '-v', target_python], checked=False)
|
||||
+ return not result['exit_code']
|
||||
+
|
||||
+
|
||||
+def identify_files_of_pypackages(syspaths):
|
||||
+ ts = rpm.TransactionSet()
|
||||
+ # add a trailing slash by calling os.path.join(..., '')
|
||||
+ roots = tuple(os.path.join(str(path), "") for path in syspaths)
|
||||
+ file_to_pkg = {}
|
||||
+
|
||||
+ # Iterate over all installed packages
|
||||
+ for header in ts.dbMatch():
|
||||
+ pkg = header['name']
|
||||
+ files = header['filenames']
|
||||
+ for filename in files:
|
||||
+ if filename and filename.endswith(PYTHON_EXTENSIONS) and filename.startswith(roots):
|
||||
+ file_to_pkg[filename] = pkg
|
||||
+ return file_to_pkg
|
||||
+
|
||||
+
|
||||
+def find_python_related(root):
|
||||
+ # recursively search for all files matching the given extension
|
||||
+ for pattern in PYTHON_EXTENSIONS:
|
||||
+ yield from root.rglob("*" + pattern)
|
||||
+
|
||||
+
|
||||
+def _should_skip_file(file):
|
||||
+ # pyc files are importable, but not if they are in __pycache__
|
||||
+ return file.name.endswith(".pyc") and file.parent.name == "__pycache__"
|
||||
+
|
||||
+
|
||||
+def scan_python_files(system_paths, rpm_files):
|
||||
+ """
|
||||
+ Scan system paths for Python files and categorize them by ownership.
|
||||
+
|
||||
+ :param system_paths: List of paths to scan for Python files
|
||||
+ :param rpm_files: Dictionary mapping file paths to RPM package names
|
||||
+ :return: Tuple of (rpms_to_check, third_party_unowned_files) where:
|
||||
+ - rpms_to_check is a dict mapping RPM names to list of their files
|
||||
+ - third_party_unowned_files is a list of files not owned by any RPM
|
||||
+ """
|
||||
+ rpms_to_check = defaultdict(list)
|
||||
+ third_party_unowned_files = []
|
||||
+
|
||||
+ for path in system_paths:
|
||||
+ if not path.is_dir():
|
||||
+ continue
|
||||
+ for file in find_python_related(path):
|
||||
+ if _should_skip_file(file):
|
||||
+ continue
|
||||
+
|
||||
+ file_path = str(file)
|
||||
+ owner = rpm_files.get(file_path)
|
||||
+ if owner:
|
||||
+ rpms_to_check[owner].append(file_path)
|
||||
+ else:
|
||||
+ third_party_unowned_files.append(file_path)
|
||||
+
|
||||
+ return rpms_to_check, third_party_unowned_files
|
||||
+
|
||||
+
|
||||
+def identify_unsigned_rpms(rpms_to_check):
|
||||
+ """
|
||||
+ Identify which RPMs are third-party (not signed by the distribution).
|
||||
+
|
||||
+ :param rpms_to_check: Dictionary mapping RPM names to list of their files
|
||||
+ :return: Tuple of (third_party_rpms, third_party_files) where:
|
||||
+ - third_party_rpms is a list of third-party RPM package names
|
||||
+ - third_party_files is a list of files from third-party RPMs
|
||||
+ """
|
||||
+ third_party_rpms = []
|
||||
+ third_party_files = []
|
||||
+
|
||||
+ for rpm_name, files in rpms_to_check.items():
|
||||
+ if not has_package(DistributionSignedRPM, rpm_name):
|
||||
+ third_party_rpms.append(rpm_name)
|
||||
+ api.current_logger().warning(
|
||||
+ 'Found Python files from non-distribution RPM package: {}'.format(rpm_name)
|
||||
+ )
|
||||
+ third_party_files.extend(files)
|
||||
+
|
||||
+ return third_party_rpms, third_party_files
|
||||
+
|
||||
+
|
||||
+def process():
|
||||
+ """
|
||||
+ Main function to scan for third-party Python modules/RPMs on the target system.
|
||||
+
|
||||
+ This function:
|
||||
+ 1. Validates the target RHEL version and Python interpreter
|
||||
+ 2. Scans system paths for Python files
|
||||
+ 3. Identifies third-party RPMs and modules
|
||||
+ 4. Produces a message if any third-party modules/RPMs are detected
|
||||
+ """
|
||||
+ target_version = get_target_major_version()
|
||||
+ target_python = get_python_binary_for_rhel(target_version)
|
||||
+
|
||||
+ if not target_python:
|
||||
+ api.current_logger().info(
|
||||
+ "RHEL version {} is not supported for third-party Python modules scanning, "
|
||||
+ "skipping check.".format(target_version)
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ if not is_target_python_present(target_python):
|
||||
+ api.current_logger().info(
|
||||
+ "Target Python interpreter {} is not installed on the source system, "
|
||||
+ "skipping check of 3rd party python modules.".format(target_python)
|
||||
+ )
|
||||
+ return
|
||||
+ system_paths = get_python_sys_paths(target_python)
|
||||
+ rpm_files = identify_files_of_pypackages(system_paths[1:])
|
||||
+
|
||||
+ rpms_to_check, third_party_unowned_files = scan_python_files(system_paths[1:], rpm_files)
|
||||
+
|
||||
+ third_party_rpms, third_party_rpm_files = identify_unsigned_rpms(rpms_to_check)
|
||||
+
|
||||
+ # Combine all third-party files (unowned + from third-party RPMs)
|
||||
+ all_third_party_files = third_party_unowned_files + third_party_rpm_files
|
||||
+
|
||||
+ if third_party_rpms or all_third_party_files:
|
||||
+ api.current_logger().warning(
|
||||
+ 'Found {} third-party RPM package(s) and {} third-party Python file(s) '
|
||||
+ 'for target Python {}'.format(
|
||||
+ len(third_party_rpms), len(all_third_party_files), target_python
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ if third_party_rpms:
|
||||
+ api.current_logger().info(
|
||||
+ 'Complete list of third-party RPM packages:{}'.format(
|
||||
+ ''.join(_formatted_list_output(third_party_rpms))
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ if all_third_party_files:
|
||||
+ api.current_logger().info(
|
||||
+ 'Complete list of third-party Python modules:{}'.format(
|
||||
+ ''.join(_formatted_list_output(all_third_party_files))
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ api.produce(ThirdPartyTargetPythonModules(
|
||||
+ target_python=target_python,
|
||||
+ third_party_modules=all_third_party_files,
|
||||
+ third_party_rpm_names=third_party_rpms
|
||||
+ ))
|
||||
diff --git a/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/tests/test_scan_third_party_target_python_modules.py b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/tests/test_scan_third_party_target_python_modules.py
|
||||
new file mode 100644
|
||||
index 00000000..796185ae
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/tests/test_scan_third_party_target_python_modules.py
|
||||
@@ -0,0 +1,136 @@
|
||||
+from collections import defaultdict, namedtuple
|
||||
+from pathlib import Path
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import scanthirdpartytargetpythonmodules
|
||||
+from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM
|
||||
+
|
||||
+Parent = namedtuple('Parent', ['name'])
|
||||
+MockFile = namedtuple('MockFile', ['name', 'parent', 'path'])
|
||||
+
|
||||
+
|
||||
+def _mock_file_str(self):
|
||||
+ return self.path
|
||||
+
|
||||
+
|
||||
+MockFile.__str__ = _mock_file_str
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('rhel_version,expected_python', [
|
||||
+ ('9', 'python3.9'),
|
||||
+ ('10', 'python3.12'),
|
||||
+ ('8', None),
|
||||
+ ('7', None),
|
||||
+ ('', None),
|
||||
+ ('invalid', None),
|
||||
+ (None, None),
|
||||
+])
|
||||
+def test_get_python_binary_for_rhel(rhel_version, expected_python):
|
||||
+ assert scanthirdpartytargetpythonmodules.get_python_binary_for_rhel(rhel_version) == expected_python
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('file_name,parent_name,should_skip', [
|
||||
+ ('module.pyc', '__pycache__', True),
|
||||
+ ('module.pyc', 'site-packages', False),
|
||||
+ ('module.py', '__pycache__', False),
|
||||
+ ('module.so', '__pycache__', False),
|
||||
+ ('module.py', 'site-packages', False),
|
||||
+ ('module.so', 'site-packages', False),
|
||||
+])
|
||||
+def test_should_skip_file(file_name, parent_name, should_skip):
|
||||
+ mock_file = MockFile(name=file_name, parent=Parent(name=parent_name), path='/dummy/path')
|
||||
+ assert scanthirdpartytargetpythonmodules._should_skip_file(mock_file) is should_skip
|
||||
+
|
||||
+
|
||||
+def test_scan_python_files(monkeypatch):
|
||||
+ system_paths = [Path('/usr/lib/python3.9/site-packages')]
|
||||
+ rpm_files = {
|
||||
+ '/usr/lib/python3.9/site-packages/rpm_module.py': 'rpm-package',
|
||||
+ '/usr/lib/python3.9/site-packages/another.py': 'another-rpm',
|
||||
+ }
|
||||
+
|
||||
+ def mock_is_dir(self):
|
||||
+ return True
|
||||
+
|
||||
+ def mock_find_python_related(root):
|
||||
+ files = [
|
||||
+ MockFile('rpm_module.py', Parent('site-packages'), '/usr/lib/python3.9/site-packages/rpm_module.py'),
|
||||
+ MockFile('unowned.py', Parent('site-packages'), '/usr/lib/python3.9/site-packages/unowned.py'),
|
||||
+ MockFile('another.py', Parent('site-packages'), '/usr/lib/python3.9/site-packages/another.py'),
|
||||
+ ]
|
||||
+ return iter(files)
|
||||
+
|
||||
+ monkeypatch.setattr(Path, 'is_dir', mock_is_dir)
|
||||
+ monkeypatch.setattr(scanthirdpartytargetpythonmodules, 'find_python_related', mock_find_python_related)
|
||||
+
|
||||
+ rpms_to_check, unowned = scanthirdpartytargetpythonmodules.scan_python_files(system_paths, rpm_files)
|
||||
+
|
||||
+ assert 'rpm-package' in rpms_to_check
|
||||
+ assert 'another-rpm' in rpms_to_check
|
||||
+ assert '/usr/lib/python3.9/site-packages/unowned.py' in unowned
|
||||
+ assert len(unowned) == 1
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('path_exists,mock_files', [
|
||||
+ (False, None),
|
||||
+ (True, [MockFile('module.pyc', Parent('__pycache__'), '/usr/lib/python3.9/site-packages/__pycache__/module.pyc')]),
|
||||
+])
|
||||
+def test_scan_python_files_filtering(monkeypatch, path_exists, mock_files):
|
||||
+ system_paths = [Path('/usr/lib/python3.9/site-packages')]
|
||||
+ rpm_files = {}
|
||||
+
|
||||
+ def mock_is_dir(self):
|
||||
+ return path_exists
|
||||
+
|
||||
+ monkeypatch.setattr(Path, 'is_dir', mock_is_dir)
|
||||
+
|
||||
+ if mock_files is not None:
|
||||
+ def mock_find_python_related(root):
|
||||
+ return iter(mock_files)
|
||||
+ monkeypatch.setattr(scanthirdpartytargetpythonmodules, 'find_python_related', mock_find_python_related)
|
||||
+
|
||||
+ rpms_to_check, unowned = scanthirdpartytargetpythonmodules.scan_python_files(system_paths, rpm_files)
|
||||
+
|
||||
+ assert len(rpms_to_check) == 0
|
||||
+ assert len(unowned) == 0
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('is_signed,expected_rpm_count,expected_file_count', [
|
||||
+ (False, 1, 2),
|
||||
+ (True, 0, 0),
|
||||
+])
|
||||
+def test_identify_unsigned_rpms(monkeypatch, is_signed, expected_rpm_count, expected_file_count):
|
||||
+ rpms_to_check = defaultdict(list)
|
||||
+ package_name = 'test-package'
|
||||
+ rpms_to_check[package_name] = [
|
||||
+ '/path/to/file1.py',
|
||||
+ '/path/to/file2.py',
|
||||
+ ]
|
||||
+
|
||||
+ def mock_has_package(model, pkg_name):
|
||||
+ return is_signed
|
||||
+
|
||||
+ monkeypatch.setattr(scanthirdpartytargetpythonmodules, 'has_package', mock_has_package)
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+
|
||||
+ third_party_rpms, third_party_files = scanthirdpartytargetpythonmodules.identify_unsigned_rpms(rpms_to_check)
|
||||
+
|
||||
+ assert len(third_party_rpms) == expected_rpm_count
|
||||
+ assert len(third_party_files) == expected_file_count
|
||||
+
|
||||
+ if not is_signed:
|
||||
+ assert package_name in third_party_rpms
|
||||
+ assert '/path/to/file1.py' in third_party_files
|
||||
+ assert '/path/to/file2.py' in third_party_files
|
||||
+
|
||||
+
|
||||
+def test_identify_unsigned_rpms_empty_input():
|
||||
+ rpms_to_check = defaultdict(list)
|
||||
+
|
||||
+ third_party_rpms, third_party_files = scanthirdpartytargetpythonmodules.identify_unsigned_rpms(rpms_to_check)
|
||||
+
|
||||
+ assert len(third_party_rpms) == 0
|
||||
+ assert len(third_party_files) == 0
|
||||
diff --git a/repos/system_upgrade/common/models/thirdpartytagetpythonmodules.py b/repos/system_upgrade/common/models/thirdpartytagetpythonmodules.py
|
||||
new file mode 100644
|
||||
index 00000000..105e9f2c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/models/thirdpartytagetpythonmodules.py
|
||||
@@ -0,0 +1,25 @@
|
||||
+from leapp.models import fields, Model
|
||||
+from leapp.topics import SystemInfoTopic
|
||||
+
|
||||
+
|
||||
+class ThirdPartyTargetPythonModules(Model):
|
||||
+ """
|
||||
+ Information about third-party target Python modules found on system.
|
||||
+
|
||||
+ """
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ target_python = fields.String()
|
||||
+ """
|
||||
+ Target system Python version.
|
||||
+ """
|
||||
+
|
||||
+ third_party_modules = fields.List(fields.String(), default=[])
|
||||
+ """
|
||||
+ List of third-party target Python modules found on the source system. Empty list if no modules found.
|
||||
+ """
|
||||
+
|
||||
+ third_party_rpm_names = fields.List(fields.String(), default=[])
|
||||
+ """
|
||||
+ List of third-party RPMs found on the source system. Empty list if no modules found.
|
||||
+ """
|
||||
diff --git a/requirements.txt b/requirements.txt
|
||||
index a1bb4725..3c79b23d 100644
|
||||
--- a/requirements.txt
|
||||
+++ b/requirements.txt
|
||||
@@ -14,3 +14,4 @@ git+https://github.com/oamg/leapp
|
||||
requests
|
||||
# pinning a py27 troublemaking transitive dependency
|
||||
lazy-object-proxy==1.5.2; python_version < '3'
|
||||
+rpm
|
||||
--
|
||||
2.51.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,39 +0,0 @@
|
||||
From d9fe5528d6e92702e2188ee28f2620275d032d53 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 11 Aug 2025 14:32:16 +0200
|
||||
Subject: [PATCH 52/55] Makefile: Make sanity-check respect $(REPOSITORIES)
|
||||
|
||||
Since b6e84f7, the sanity check, runs in each repository and doesn't
|
||||
respect $(REPOSITORIES). This breaks the sanity-check when it's run with
|
||||
a version of Python which is incompatible with the code in particular
|
||||
repository.
|
||||
|
||||
For example with python3.6 and el9toel10 repo, python crashes with the
|
||||
following because python3.6 doesn't understand the type hint:
|
||||
File "/payload/repos/system_upgrade/el9toel10/actors/mysql/scanmysql/libraries/scanmysql.py", line 35, in <module>
|
||||
def _check_incompatible_config() -> set[str]:
|
||||
TypeError: 'type' object is not subscriptable
|
||||
---
|
||||
Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 64115006..b1d807e1 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -373,9 +373,9 @@ lint_fix:
|
||||
test_no_lint:
|
||||
@. $(VENVNAME)/bin/activate; \
|
||||
snactor repo find --path repos/; \
|
||||
- for dir in repos/system_upgrade/*/; do \
|
||||
- echo "Running sanity-check in $$dir"; \
|
||||
- (cd $$dir && snactor workflow sanity-check ipu); \
|
||||
+ for dir in $$(echo $(REPOSITORIES) | tr "," " "); do \
|
||||
+ echo "Running sanity-check in $(_SYSUPG_REPOS)/$$dir"; \
|
||||
+ (cd $(_SYSUPG_REPOS)/$$dir && snactor workflow sanity-check ipu); \
|
||||
done; \
|
||||
$(_PYTHON_VENV) -m pytest $(REPORT_ARG) $(TEST_PATHS) $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,178 +0,0 @@
|
||||
From 60a1fa88d3a8c93063eb67b9604ac030ed7f1c3a Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 11 Aug 2025 14:32:40 +0200
|
||||
Subject: [PATCH 53/55] Makefile: Partially fix ACTOR tests and enable them in
|
||||
containers
|
||||
|
||||
The ACTOR variable for running tests of a single actor has long been
|
||||
unusable, git bisect led me to dc3abf6 as the commit where
|
||||
it was (first?) broken due to the same model module being defined in
|
||||
both el7toel8 and el8toel9 repos.
|
||||
|
||||
This patch unfortunately doesn't fix that, but works around it by
|
||||
enabling the utils/actor_path.py script to search in specific
|
||||
repositories. These are passed from the Makefile via REPOSITORIES
|
||||
variable.
|
||||
|
||||
As the Makefile rules for containerized tests already use repositories,
|
||||
the ACTOR variable is just passed along.
|
||||
|
||||
NOTE: the code in actor_path.py is ugly and uses private APIs, however
|
||||
that's nothing new :).
|
||||
---
|
||||
Makefile | 44 +++++++++++++++++++++++++++++++-------------
|
||||
utils/actor_path.py | 35 ++++++++++++++++++++++++++---------
|
||||
2 files changed, 57 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index b1d807e1..59671f06 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -12,24 +12,29 @@ REPOS_PATH=repos
|
||||
_SYSUPG_REPOS="$(REPOS_PATH)/system_upgrade"
|
||||
LIBRARY_PATH=
|
||||
REPORT_ARG=
|
||||
-REPOSITORIES ?= $(shell ls $(_SYSUPG_REPOS) | xargs echo | tr " " ",")
|
||||
-SYSUPG_TEST_PATHS=$(shell echo $(REPOSITORIES) | sed -r "s|(,\\|^)| $(_SYSUPG_REPOS)/|g")
|
||||
-TEST_PATHS:=commands repos/common $(SYSUPG_TEST_PATHS)
|
||||
-
|
||||
-# Several commands can take arbitrary user supplied arguments from environment
|
||||
-# variables as well:
|
||||
-PYTEST_ARGS ?=
|
||||
-PYLINT_ARGS ?=
|
||||
-FLAKE8_ARGS ?=
|
||||
|
||||
# python version to run test with
|
||||
_PYTHON_VENV=$${PYTHON_VENV:-python3.6}
|
||||
|
||||
ifdef ACTOR
|
||||
- TEST_PATHS=`$(_PYTHON_VENV) utils/actor_path.py $(ACTOR)`
|
||||
+ # If REPOSITORIES is set, the utils/actor_path.py script searches for the
|
||||
+ # actor only in the specified repositories.
|
||||
+ # if REPOSITORIES is not set i.e. it's empty, all repositories are searched
|
||||
+ # - this is broken due to name collisions in repositories (FIXME)
|
||||
+ TEST_PATHS=$(shell . $(VENVNAME)/bin/activate && $(_PYTHON_VENV) utils/actor_path.py $(ACTOR) $(REPOSITORIES))
|
||||
APPROX_TEST_PATHS=$(shell $(_PYTHON_VENV) utils/find_actors.py -C repos $(ACTOR)) # Dev only
|
||||
+else
|
||||
+ REPOSITORIES ?= $(shell ls $(_SYSUPG_REPOS) | xargs echo | tr " " ",")
|
||||
+ SYSUPG_TEST_PATHS=$(shell echo $(REPOSITORIES) | sed -r "s|(,\\|^)| $(_SYSUPG_REPOS)/|g")
|
||||
+ TEST_PATHS:=commands repos/common $(SYSUPG_TEST_PATHS)
|
||||
endif
|
||||
|
||||
+# Several commands can take arbitrary user supplied arguments from environment
|
||||
+# variables as well:
|
||||
+PYTEST_ARGS ?=
|
||||
+PYLINT_ARGS ?=
|
||||
+FLAKE8_ARGS ?=
|
||||
+
|
||||
ifeq ($(TEST_LIBS),y)
|
||||
LIBRARY_PATH=`python utils/library_path.py`
|
||||
endif
|
||||
@@ -371,12 +376,24 @@ lint_fix:
|
||||
echo "--- isort inplace fixing done. ---;"
|
||||
|
||||
test_no_lint:
|
||||
- @. $(VENVNAME)/bin/activate; \
|
||||
+ @if [ -z "$(REPOSITORIES)" -a -n "$(ACTOR)" ]; then \
|
||||
+ printf "\033[0;31mWARNING\033[0m: Running tests with ACTOR without"; \
|
||||
+ printf " specifying REPOSITORIES is currently broken.\n" 2>&1; \
|
||||
+ printf " Specify REPOSITORIES with only one elXtoelY repository"; \
|
||||
+ printf " (e.g. REPOSITORIES=common,el8toel9).\n" 2>&1; \
|
||||
+ exit 1; \
|
||||
+ fi
|
||||
+
|
||||
+ @echo "============= snactor sanity-check ipu ===============" 2>&1
|
||||
+ . $(VENVNAME)/bin/activate; \
|
||||
snactor repo find --path repos/; \
|
||||
for dir in $$(echo $(REPOSITORIES) | tr "," " "); do \
|
||||
echo "Running sanity-check in $(_SYSUPG_REPOS)/$$dir"; \
|
||||
(cd $(_SYSUPG_REPOS)/$$dir && snactor workflow sanity-check ipu); \
|
||||
- done; \
|
||||
+ done
|
||||
+
|
||||
+ @echo "==================== unit tests ======================" 2>&1
|
||||
+ . $(VENVNAME)/bin/activate; \
|
||||
$(_PYTHON_VENV) -m pytest $(REPORT_ARG) $(TEST_PATHS) $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
|
||||
test: lint test_no_lint
|
||||
@@ -407,7 +424,7 @@ _test_container_ipu:
|
||||
;; \
|
||||
esac && \
|
||||
$(_CONTAINER_TOOL) exec -w /repocopy $$_CONT_NAME make clean && \
|
||||
- $(_CONTAINER_TOOL) exec -w /repocopy -e REPOSITORIES $$_CONT_NAME make $${_TEST_CONT_TARGET:-test}
|
||||
+ $(_CONTAINER_TOOL) exec -w /repocopy -e ACTOR -e REPOSITORIES $$_CONT_NAME make $${_TEST_CONT_TARGET:-test}
|
||||
|
||||
|
||||
# Runs lint in a container
|
||||
@@ -449,6 +466,7 @@ test_container:
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
$(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
$(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude '**/__pycache__/' /repo/commands/ /repocopy/tut/lib/$$_VENV/site-packages/leapp/cli/commands/ && \
|
||||
+ $(_CONTAINER_TOOL) exec -w /repocopy $$_CONT_NAME bash -c '. $(VENVNAME)/bin/activate && snactor repo find --path repos' && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
python3.6) \
|
||||
diff --git a/utils/actor_path.py b/utils/actor_path.py
|
||||
index 5c53a16a..3c61ce79 100755
|
||||
--- a/utils/actor_path.py
|
||||
+++ b/utils/actor_path.py
|
||||
@@ -1,7 +1,10 @@
|
||||
import logging
|
||||
+import os
|
||||
import sys
|
||||
|
||||
-from leapp.repository.scan import find_and_scan_repositories
|
||||
+from leapp.repository.manager import RepositoryManager
|
||||
+from leapp.repository.scan import _resolve_repository_links, find_and_scan_repositories, scan_repo
|
||||
+
|
||||
|
||||
def err_exit():
|
||||
# We want to be sure that `make test` (test_no_lint) will stop when expected
|
||||
@@ -10,22 +13,36 @@ def err_exit():
|
||||
sys.stdout.write('ERROR:__read_error_messages_above_this_one_on_stderr__')
|
||||
sys.exit(1)
|
||||
|
||||
+
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO, filename='/dev/null')
|
||||
logger = logging.getLogger('run_pytest.py')
|
||||
|
||||
BASE_REPO = 'repos'
|
||||
- repos = find_and_scan_repositories(BASE_REPO, include_locals=True)
|
||||
- repos.load()
|
||||
- if len(sys.argv) > 1:
|
||||
- actors = repos._lookup_actors(sys.argv[1])
|
||||
- if not actors:
|
||||
- sys.stderr.write('ERROR: No actor found for search "{}"\n'.format(sys.argv[1]))
|
||||
- err_exit()
|
||||
- print(' '.join([actor.full_path for actor in actors]))
|
||||
+ SYSUPG_REPO = os.path.join(BASE_REPO, 'system_upgrade')
|
||||
+
|
||||
+ if len(sys.argv) == 2:
|
||||
+ manager = find_and_scan_repositories(BASE_REPO, include_locals=True)
|
||||
+ manager.load()
|
||||
+ elif len(sys.argv) == 3:
|
||||
+ repos = sys.argv[2].split(',')
|
||||
+ # TODO: it would be nicer to have some function in the framework for
|
||||
+ # the scanning and resolving done below
|
||||
+ manager = RepositoryManager()
|
||||
+ for repo in repos:
|
||||
+ manager.add_repo(scan_repo(os.path.join(SYSUPG_REPO, repo)))
|
||||
+ _resolve_repository_links(manager=manager, include_locals=True)
|
||||
+ manager.load()
|
||||
else:
|
||||
sys.stderr.write('ERROR: Missing commandline argument\n')
|
||||
+ sys.stderr.write('Usage: actor_path.py <actor_name> [repositories]\n')
|
||||
+ err_exit()
|
||||
+
|
||||
+ actors = manager._lookup_actors(sys.argv[1])
|
||||
+ if not actors:
|
||||
+ sys.stderr.write('ERROR: No actor found for search "{}"\n'.format(sys.argv[1]))
|
||||
err_exit()
|
||||
+ print(' '.join([actor.full_path for actor in actors]))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
From 4e182e84fc8ebd499dfc9f9e2caf4ae7dd63fb60 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Fri, 25 Jul 2025 16:27:42 +0200
|
||||
Subject: [PATCH 54/55] make: error uniformly when ACTOR without REPOSITORIES
|
||||
is used
|
||||
|
||||
Using ACTOR withtout REPOSITORIES leads to a dead lock during actor
|
||||
discovery (likely due to the 'multipathconfcheck' actor). This patch
|
||||
adds a new make target that prevents the use of ACTOR without
|
||||
REPOSITORIES.
|
||||
---
|
||||
Makefile | 22 ++++++++++++----------
|
||||
1 file changed, 12 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 59671f06..039b3e9e 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -339,7 +339,7 @@ install-deps-fedora:
|
||||
$(VENVNAME)/bin/pip install -I "git+https://github.com/oamg/leapp.git@refs/pull/$(REQ_LEAPP_PR)/head"; \
|
||||
fi
|
||||
|
||||
-lint:
|
||||
+lint: _warn_misssing_repos_if_using_actor
|
||||
. $(VENVNAME)/bin/activate; \
|
||||
echo "--- Linting ... ---" && \
|
||||
SEARCH_PATH="$(TEST_PATHS)" && \
|
||||
@@ -375,14 +375,7 @@ lint_fix:
|
||||
git diff $(MASTER_BRANCH) --name-only --diff-filter AMR | grep -v "^docs/" | xargs isort && \
|
||||
echo "--- isort inplace fixing done. ---;"
|
||||
|
||||
-test_no_lint:
|
||||
- @if [ -z "$(REPOSITORIES)" -a -n "$(ACTOR)" ]; then \
|
||||
- printf "\033[0;31mWARNING\033[0m: Running tests with ACTOR without"; \
|
||||
- printf " specifying REPOSITORIES is currently broken.\n" 2>&1; \
|
||||
- printf " Specify REPOSITORIES with only one elXtoelY repository"; \
|
||||
- printf " (e.g. REPOSITORIES=common,el8toel9).\n" 2>&1; \
|
||||
- exit 1; \
|
||||
- fi
|
||||
+test_no_lint: _warn_misssing_repos_if_using_actor
|
||||
|
||||
@echo "============= snactor sanity-check ipu ===============" 2>&1
|
||||
. $(VENVNAME)/bin/activate; \
|
||||
@@ -538,5 +531,14 @@ dashboard_data:
|
||||
$(_PYTHON_VENV) ../../../utils/dashboard-json-dump.py > ../../../discover.json; \
|
||||
popd
|
||||
|
||||
-.PHONY: help build clean prepare source srpm copr_build _build_local build_container print_release register install-deps install-deps-fedora lint test_no_lint test dashboard_data fast_lint
|
||||
+_warn_misssing_repos_if_using_actor:
|
||||
+ @if [ -z "$(REPOSITORIES)" -a -n "$(ACTOR)" ]; then \
|
||||
+ printf "\033[0;31mERROR\033[0m: Running linters/tests with ACTOR without"; \
|
||||
+ printf " specifying REPOSITORIES is currently broken.\n" 2>&1; \
|
||||
+ printf " Specify REPOSITORIES with only one elXtoelY repository"; \
|
||||
+ printf " (e.g. REPOSITORIES=common,el8toel9).\n" 2>&1; \
|
||||
+ exit 1; \
|
||||
+ fi
|
||||
+
|
||||
+.PHONY: help build clean prepare source srpm copr_build _build_local build_container print_release register install-deps install-deps-fedora lint test_no_lint test dashboard_data fast_lint _warn_missing_repos_if_using_actor
|
||||
.PHONY: test_container test_container_no_lint test_container_all test_container_all_no_lint clean_containers _build_container_image _test_container_ipu dev_test_no_lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
From b7f862249e2227d2c5f3f6e33d74f8d2a2367a11 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 16 Oct 2025 19:28:22 +0200
|
||||
Subject: [PATCH 55/55] Makefile: Skip tests with ACTOR when it's not present
|
||||
in REPOSITORIES
|
||||
|
||||
---
|
||||
Makefile | 17 +++++++++++++----
|
||||
1 file changed, 13 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 039b3e9e..0db240a9 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -21,7 +21,7 @@ ifdef ACTOR
|
||||
# actor only in the specified repositories.
|
||||
# if REPOSITORIES is not set i.e. it's empty, all repositories are searched
|
||||
# - this is broken due to name collisions in repositories (FIXME)
|
||||
- TEST_PATHS=$(shell . $(VENVNAME)/bin/activate && $(_PYTHON_VENV) utils/actor_path.py $(ACTOR) $(REPOSITORIES))
|
||||
+ TEST_PATHS = $(shell . $(VENVNAME)/bin/activate && $(_PYTHON_VENV) utils/actor_path.py $(ACTOR) $(REPOSITORIES))
|
||||
APPROX_TEST_PATHS=$(shell $(_PYTHON_VENV) utils/find_actors.py -C repos $(ACTOR)) # Dev only
|
||||
else
|
||||
REPOSITORIES ?= $(shell ls $(_SYSUPG_REPOS) | xargs echo | tr " " ",")
|
||||
@@ -376,7 +376,6 @@ lint_fix:
|
||||
echo "--- isort inplace fixing done. ---;"
|
||||
|
||||
test_no_lint: _warn_misssing_repos_if_using_actor
|
||||
-
|
||||
@echo "============= snactor sanity-check ipu ===============" 2>&1
|
||||
. $(VENVNAME)/bin/activate; \
|
||||
snactor repo find --path repos/; \
|
||||
@@ -385,9 +384,19 @@ test_no_lint: _warn_misssing_repos_if_using_actor
|
||||
(cd $(_SYSUPG_REPOS)/$$dir && snactor workflow sanity-check ipu); \
|
||||
done
|
||||
|
||||
- @echo "==================== unit tests ======================" 2>&1
|
||||
+ @echo "==================== unit tests ======================" 2>&1;
|
||||
+# the below commands need to be one shell invocation for the early exit to work;
|
||||
+# note: need to store the paths into separate var as it here as it's lazily
|
||||
+# evaluated on each use :), using ?= for the assignment does not help for
|
||||
+# some reason
|
||||
+ @paths="$(TEST_PATHS)"; \
|
||||
+ if [[ $$(echo "$$paths" | grep 'ERROR:') && -n "$(ACTOR)" ]]; then \
|
||||
+ echo Failed to find the '$(ACTOR)' actor in the '$(REPOSITORIES)' repositories: $$paths; \
|
||||
+ printf "\033[0;33mSkipping unit tests, could not find the '$(ACTOR)' actor in $(REPOSITORIES) repositories\033[0m\n"; \
|
||||
+ exit 0; \
|
||||
+ fi; \
|
||||
. $(VENVNAME)/bin/activate; \
|
||||
- $(_PYTHON_VENV) -m pytest $(REPORT_ARG) $(TEST_PATHS) $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
+ $(_PYTHON_VENV) -m pytest $(REPORT_ARG) $$paths $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
|
||||
test: lint test_no_lint
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
From b2dab41ff9d9492a5e121bbce729ea07a5d41330 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 29 Sep 2025 21:19:18 +0200
|
||||
Subject: [PATCH 56/69] Add LEAPP_DEVEL_TARGET_OS devel environment var
|
||||
|
||||
Allow setting the target OS for development purposes. Internally (cannot
|
||||
be set by the user) the LEAPP_TARGET_OS envar is set, similarly to how
|
||||
this works other arguments.
|
||||
|
||||
Note that this patch only adds the variable and stores it into
|
||||
LEAPP_TARGET_OS, otherwise it is unhandled.
|
||||
---
|
||||
commands/upgrade/util.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/commands/upgrade/util.py b/commands/upgrade/util.py
|
||||
index dadfe7de..1c88eab8 100644
|
||||
--- a/commands/upgrade/util.py
|
||||
+++ b/commands/upgrade/util.py
|
||||
@@ -221,9 +221,13 @@ def prepare_configuration(args):
|
||||
if args.enable_experimental_feature:
|
||||
os.environ['LEAPP_EXPERIMENTAL'] = '1'
|
||||
|
||||
+ os.environ["LEAPP_TARGET_OS"] = os.getenv(
|
||||
+ "LEAPP_DEVEL_TARGET_OS", command_utils.get_distro_id()
|
||||
+ )
|
||||
+
|
||||
os.environ['LEAPP_UNSUPPORTED'] = '0' if os.getenv('LEAPP_UNSUPPORTED', '0') == '0' else '1'
|
||||
# force no rhsm on non-rhel systems, regardless of whether the binary is there
|
||||
- if args.no_rhsm or command_utils.get_distro_id() != 'rhel':
|
||||
+ if args.no_rhsm or os.environ['LEAPP_TARGET_OS'] != 'rhel':
|
||||
os.environ['LEAPP_NO_RHSM'] = '1'
|
||||
elif not os.path.exists('/usr/sbin/subscription-manager'):
|
||||
os.environ['LEAPP_NO_RHSM'] = '1'
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,195 +0,0 @@
|
||||
From ff0f962147fc3af6cfd78f6251ddaa8cf94705c6 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 18 Sep 2025 19:44:57 +0200
|
||||
Subject: [PATCH 57/69] commands: Get target version based on target distro
|
||||
|
||||
Jira: RHEL-110563
|
||||
---
|
||||
commands/command_utils.py | 48 ++++++++++++++-------
|
||||
commands/tests/test_upgrade_paths.py | 63 +++++++++++++++++++++-------
|
||||
2 files changed, 80 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/commands/command_utils.py b/commands/command_utils.py
|
||||
index 647e7b44..31125da5 100644
|
||||
--- a/commands/command_utils.py
|
||||
+++ b/commands/command_utils.py
|
||||
@@ -62,9 +62,9 @@ def assert_version_format(version_str, desired_format, version_kind):
|
||||
"""
|
||||
if not re.match(desired_format.regex, version_str):
|
||||
error_str = (
|
||||
- 'Unexpected format of target version: {0}. The required format is \'{1}\'.'
|
||||
- )
|
||||
- raise CommandError(error_str.format(version_str, desired_format.human_readable))
|
||||
+ "Unexpected format of {} version: {}. The required format is '{}'."
|
||||
+ ).format(version_kind.value, version_str, desired_format.human_readable)
|
||||
+ raise CommandError(error_str)
|
||||
|
||||
|
||||
def get_major_version_from_a_valid_version(version):
|
||||
@@ -165,7 +165,17 @@ def get_target_versions_from_config(src_version_id, distro, flavor):
|
||||
return upgrade_paths_map.get(distro, {}).get(flavor, {}).get(src_version_id, [])
|
||||
|
||||
|
||||
-def get_supported_target_versions(flavour=get_upgrade_flavour()):
|
||||
+def get_virtual_version_from_config(src_version_id, distro):
|
||||
+ """
|
||||
+ Retrieve the virtual version for the given version from upgrade_paths_map.
|
||||
+
|
||||
+ :return: The virtual version or None if no match.
|
||||
+ """
|
||||
+ upgrade_paths_map = get_upgrade_paths_config()
|
||||
+ return upgrade_paths_map.get(distro, {}).get('_virtual_versions').get(src_version_id)
|
||||
+
|
||||
+
|
||||
+def get_supported_target_versions(target_distro, flavour=get_upgrade_flavour()):
|
||||
"""
|
||||
Return a list of supported target versions for the given `flavour` of upgrade.
|
||||
The default value for `flavour` is `default`.
|
||||
@@ -173,26 +183,30 @@ def get_supported_target_versions(flavour=get_upgrade_flavour()):
|
||||
|
||||
os_release_contents = _retrieve_os_release_contents()
|
||||
current_version_id = os_release_contents.get('VERSION_ID', '')
|
||||
- distro_id = os_release_contents.get('ID', '')
|
||||
+ source_distro = os_release_contents.get('ID', '')
|
||||
|
||||
# We want to guarantee our actors that if they see 'centos'/'rhel'/...
|
||||
# then they will always see expected version format
|
||||
- expected_version_format = _DISTRO_VERSION_FORMATS.get(distro_id, VersionFormats.MAJOR_MINOR).value
|
||||
- assert_version_format(current_version_id, expected_version_format, _VersionKind.SOURCE)
|
||||
+ expected_version_format = _DISTRO_VERSION_FORMATS.get(source_distro, VersionFormats.MAJOR_MINOR)
|
||||
+ assert_version_format(current_version_id, expected_version_format.value, _VersionKind.SOURCE)
|
||||
+ if source_distro == 'centos' and target_distro != 'centos':
|
||||
+ # when upconverting from centos, we need to lookup by virtual version
|
||||
+ current_version_id = get_virtual_version_from_config(current_version_id, source_distro)
|
||||
|
||||
- target_versions = get_target_versions_from_config(current_version_id, distro_id, flavour)
|
||||
+ target_versions = get_target_versions_from_config(current_version_id, target_distro, flavour)
|
||||
if not target_versions:
|
||||
# If we cannot find a particular major.minor version in the map,
|
||||
# we fallback to pick a target version just based on a major version.
|
||||
- # This can happen for example when testing not yet released versions
|
||||
+ # This can happen for example when testing not yet released versions.
|
||||
+ # But also removes the need to handle virtual versions on X->centos upgrades.
|
||||
major_version = get_major_version_from_a_valid_version(current_version_id)
|
||||
- target_versions = get_target_versions_from_config(major_version, distro_id, flavour)
|
||||
+ target_versions = get_target_versions_from_config(major_version, target_distro, flavour)
|
||||
|
||||
return target_versions
|
||||
|
||||
|
||||
-def get_target_version(flavour):
|
||||
- target_versions = get_supported_target_versions(flavour)
|
||||
+def get_target_version(flavour, target_distro):
|
||||
+ target_versions = get_supported_target_versions(target_distro, flavour)
|
||||
return target_versions[-1] if target_versions else None
|
||||
|
||||
|
||||
@@ -214,13 +228,15 @@ def get_target_release(args):
|
||||
env_version_override = os.getenv('LEAPP_DEVEL_TARGET_RELEASE')
|
||||
|
||||
target_ver = env_version_override or args.target
|
||||
+ target_distro_id = os.getenv('LEAPP_TARGET_OS')
|
||||
if target_ver:
|
||||
- distro_id = get_distro_id()
|
||||
- expected_version_format = _DISTRO_VERSION_FORMATS.get(distro_id, VersionFormats.MAJOR_MINOR).value
|
||||
- assert_version_format(target_ver, expected_version_format, _VersionKind.TARGET)
|
||||
+ expected_version_format = _DISTRO_VERSION_FORMATS.get(
|
||||
+ target_distro_id, VersionFormats.MAJOR_MINOR
|
||||
+ )
|
||||
+ assert_version_format(target_ver, expected_version_format.value, _VersionKind.TARGET)
|
||||
return (target_ver, flavor)
|
||||
|
||||
- return (get_target_version(flavor), flavor)
|
||||
+ return (get_target_version(flavor, target_distro_id), flavor)
|
||||
|
||||
|
||||
def set_resource_limits():
|
||||
diff --git a/commands/tests/test_upgrade_paths.py b/commands/tests/test_upgrade_paths.py
|
||||
index 9bdf5792..95e6519a 100644
|
||||
--- a/commands/tests/test_upgrade_paths.py
|
||||
+++ b/commands/tests/test_upgrade_paths.py
|
||||
@@ -8,26 +8,54 @@ from leapp.cli.commands import command_utils
|
||||
from leapp.exceptions import CommandError
|
||||
|
||||
|
||||
-@mock.patch("leapp.cli.commands.command_utils.get_upgrade_paths_config",
|
||||
- return_value={'rhel': {"default": {"7.9": ["8.4"], "8.6": ["9.0"], "7": ["8.4"], "8": ["9.0"]}}})
|
||||
+@mock.patch(
|
||||
+ "leapp.cli.commands.command_utils.get_upgrade_paths_config",
|
||||
+ return_value={
|
||||
+ "rhel": {
|
||||
+ "default": {"7.9": ["8.4"], "8.6": ["9.0"], "8.7": ["9.1"], "7": ["8.4"], "8": ["9.0"]}
|
||||
+ },
|
||||
+ "centos": {
|
||||
+ "default": {"8": ["9"], "9": ["10"]},
|
||||
+ "_virtual_versions": {"8": "8.7", "9": "9.8", "10": "10.2"},
|
||||
+ },
|
||||
+ "alma": {
|
||||
+ "default": {"7.9": ["8.4"], "8.6": ["9.0"], "8.7": ["9.1"]}
|
||||
+ },
|
||||
+ },
|
||||
+)
|
||||
def test_get_target_version(mock_open, monkeypatch):
|
||||
- etc_os_release_contents = {'ID': 'rhel', 'VERSION_ID': '8.6'}
|
||||
- monkeypatch.setattr(command_utils, '_retrieve_os_release_contents',
|
||||
- lambda *args, **kwargs: etc_os_release_contents)
|
||||
- assert command_utils.get_target_version('default') == '9.0'
|
||||
|
||||
+ def set_etc_osrelease(distro_id, version_id):
|
||||
+ etc_os_release_contents = {"ID": distro_id, "VERSION_ID": version_id}
|
||||
+ monkeypatch.setattr(
|
||||
+ command_utils,
|
||||
+ "_retrieve_os_release_contents",
|
||||
+ lambda *args, **kwargs: etc_os_release_contents,
|
||||
+ )
|
||||
+
|
||||
+ set_etc_osrelease('rhel', '8.6')
|
||||
+ assert command_utils.get_target_version('default', 'rhel') == '9.0'
|
||||
+
|
||||
+ # the envar should not affect this function
|
||||
monkeypatch.setenv('LEAPP_DEVEL_TARGET_RELEASE', '')
|
||||
- etc_os_release_contents = {'ID': 'rhel', 'VERSION_ID': '8.6'}
|
||||
- monkeypatch.setattr(command_utils, '_retrieve_os_release_contents',
|
||||
- lambda *args, **kwargs: etc_os_release_contents)
|
||||
- assert command_utils.get_target_version('default') == '9.0'
|
||||
+ assert command_utils.get_target_version('default', 'rhel') == '9.0'
|
||||
|
||||
+ # unsupported path, matches because of the major version fallback
|
||||
monkeypatch.delenv('LEAPP_DEVEL_TARGET_RELEASE', raising=True)
|
||||
- # unsupported path
|
||||
- etc_os_release_contents = {'ID': 'rhel', 'VERSION_ID': '8.5'}
|
||||
- monkeypatch.setattr(command_utils, '_retrieve_os_release_contents',
|
||||
- lambda *args, **kwargs: etc_os_release_contents)
|
||||
- assert command_utils.get_target_version('default') == '9.0'
|
||||
+ set_etc_osrelease('rhel', '8.5')
|
||||
+ assert command_utils.get_target_version('default', 'rhel') == '9.0'
|
||||
+
|
||||
+ # centos->centos
|
||||
+ set_etc_osrelease('centos', '9')
|
||||
+ assert command_utils.get_target_version('default', 'centos') == '10'
|
||||
+
|
||||
+ # centos->rhel, lookup based on virtual versions
|
||||
+ set_etc_osrelease('centos', '8')
|
||||
+ assert command_utils.get_target_version('default', 'rhel') == '9.1'
|
||||
+
|
||||
+ # rhel->centos, reverse virtual versions lookup
|
||||
+ set_etc_osrelease('rhel', '8.6')
|
||||
+ assert command_utils.get_target_version('default', 'centos') == '9'
|
||||
|
||||
|
||||
@mock.patch(
|
||||
@@ -42,6 +70,11 @@ def test_get_target_version(mock_open, monkeypatch):
|
||||
},
|
||||
)
|
||||
def test_get_target_release(mock_open, monkeypatch): # do not remove mock_open
|
||||
+ # NOTE Not testing with other distros, the tested function is mainly about
|
||||
+ # handling of the CLI option, envar and format checking, the real target
|
||||
+ # release retrieval is handled in get_target_version which is tested with
|
||||
+ # different source/target distro combinanations elsewhere.
|
||||
+
|
||||
# Make it look like it's RHEL even on centos, because that's what the test
|
||||
# assumes.
|
||||
# Otherwise the test, when ran on Centos, fails because it works
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,227 +0,0 @@
|
||||
From a8ed1d70bde82ad7ff35fcf02648ff246c28dd88 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 12 Sep 2025 14:32:06 +0200
|
||||
Subject: [PATCH 58/69] ipuconfig: Add source and target distros to config
|
||||
|
||||
The distros are now stored similarly to how versions are stored.
|
||||
|
||||
CurrentActorMocked is modified to take src_distro and dst_distro as
|
||||
arguments. Although there is already release_id parameter which is kept
|
||||
for compatibility.
|
||||
|
||||
Jira: RHEL-110563
|
||||
---
|
||||
.../libraries/ipuworkflowconfig.py | 9 +++-
|
||||
.../common/libraries/config/__init__.py | 2 +-
|
||||
.../common/libraries/config/mock_configs.py | 26 ++++++++---
|
||||
.../common/libraries/testutils.py | 44 +++++++++++++++----
|
||||
.../system_upgrade/common/models/ipuconfig.py | 13 ++++++
|
||||
5 files changed, 78 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
index f76677fd..dd84f3a1 100644
|
||||
--- a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
@@ -4,7 +4,7 @@ import platform
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import EnvVar, IPUConfig, IPUSourceToPossibleTargets, OSRelease, Version
|
||||
+from leapp.models import Distro, EnvVar, IPUConfig, IPUSourceToPossibleTargets, OSRelease, Version
|
||||
|
||||
ENV_IGNORE = ('LEAPP_CURRENT_PHASE', 'LEAPP_CURRENT_ACTOR', 'LEAPP_VERBOSE',
|
||||
'LEAPP_DEBUG')
|
||||
@@ -169,6 +169,7 @@ def produce_ipu_config(actor):
|
||||
os_release.release_id,
|
||||
source_version,
|
||||
target_version)
|
||||
+ target_distro = os.environ.get('LEAPP_TARGET_OS')
|
||||
|
||||
actor.produce(IPUConfig(
|
||||
leapp_env_vars=get_env_vars(),
|
||||
@@ -182,5 +183,9 @@ def produce_ipu_config(actor):
|
||||
),
|
||||
kernel=get_booted_kernel(),
|
||||
flavour=flavour,
|
||||
- supported_upgrade_paths=exposed_supported_paths
|
||||
+ supported_upgrade_paths=exposed_supported_paths,
|
||||
+ distro=Distro(
|
||||
+ source=os_release.release_id,
|
||||
+ target=target_distro,
|
||||
+ ),
|
||||
))
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/__init__.py b/repos/system_upgrade/common/libraries/config/__init__.py
|
||||
index 0c737f93..11d26c0e 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/__init__.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/__init__.py
|
||||
@@ -109,4 +109,4 @@ def get_distro_id():
|
||||
:return: The ID string from /etc/os_release
|
||||
:rtype: str
|
||||
"""
|
||||
- return api.current_actor().configuration.os_release.release_id
|
||||
+ return api.current_actor().configuration.distro.source
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/mock_configs.py b/repos/system_upgrade/common/libraries/config/mock_configs.py
|
||||
index a7ee0000..a0daac74 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/mock_configs.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/mock_configs.py
|
||||
@@ -6,7 +6,7 @@ The library is supposed to be used only for testing purposes. Import of the
|
||||
library is expected only inside test files.
|
||||
"""
|
||||
|
||||
-from leapp.models import EnvVar, IPUConfig, IPUSourceToPossibleTargets, OSRelease, Version
|
||||
+from leapp.models import Distro, EnvVar, IPUConfig, IPUSourceToPossibleTargets, OSRelease, Version
|
||||
|
||||
CONFIG = IPUConfig(
|
||||
leapp_env_vars=[EnvVar(name='LEAPP_DEVEL', value='0')],
|
||||
@@ -27,7 +27,11 @@ CONFIG = IPUConfig(
|
||||
kernel='3.10.0-957.43.1.el7.x86_64',
|
||||
supported_upgrade_paths=[
|
||||
IPUSourceToPossibleTargets(source_version='7.6', target_versions=['8.0'])
|
||||
- ]
|
||||
+ ],
|
||||
+ distro=Distro(
|
||||
+ source='rhel',
|
||||
+ target='rhel',
|
||||
+ ),
|
||||
)
|
||||
|
||||
CONFIG_NO_NETWORK_RENAMING = IPUConfig(
|
||||
@@ -49,7 +53,11 @@ CONFIG_NO_NETWORK_RENAMING = IPUConfig(
|
||||
kernel='3.10.0-957.43.1.el7.x86_64',
|
||||
supported_upgrade_paths=[
|
||||
IPUSourceToPossibleTargets(source_version='7.6', target_versions=['8.0'])
|
||||
- ]
|
||||
+ ],
|
||||
+ distro=Distro(
|
||||
+ source='rhel',
|
||||
+ target='rhel',
|
||||
+ ),
|
||||
)
|
||||
|
||||
CONFIG_ALL_SIGNED = IPUConfig(
|
||||
@@ -71,7 +79,11 @@ CONFIG_ALL_SIGNED = IPUConfig(
|
||||
kernel='3.10.0-957.43.1.el7.x86_64',
|
||||
supported_upgrade_paths=[
|
||||
IPUSourceToPossibleTargets(source_version='7.6', target_versions=['8.0'])
|
||||
- ]
|
||||
+ ],
|
||||
+ distro=Distro(
|
||||
+ source='rhel',
|
||||
+ target='rhel',
|
||||
+ ),
|
||||
)
|
||||
|
||||
CONFIG_S390X = IPUConfig(
|
||||
@@ -92,5 +104,9 @@ CONFIG_S390X = IPUConfig(
|
||||
kernel='3.10.0-957.43.1.el7.x86_64',
|
||||
supported_upgrade_paths=[
|
||||
IPUSourceToPossibleTargets(source_version='7.6', target_versions=['8.0'])
|
||||
- ]
|
||||
+ ],
|
||||
+ distro=Distro(
|
||||
+ source='rhel',
|
||||
+ target='rhel',
|
||||
+ ),
|
||||
)
|
||||
diff --git a/repos/system_upgrade/common/libraries/testutils.py b/repos/system_upgrade/common/libraries/testutils.py
|
||||
index 107ad8a7..0a56d698 100644
|
||||
--- a/repos/system_upgrade/common/libraries/testutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/testutils.py
|
||||
@@ -78,12 +78,27 @@ def _make_default_config(actor_config_schema):
|
||||
# pattern would be nice here. Ideally, the builder should actively prevent the developer from setting fields
|
||||
# that do not affect actor's behavior in __setattr__.
|
||||
class CurrentActorMocked: # pylint:disable=R0904
|
||||
- def __init__(self, arch=architecture.ARCH_X86_64, envars=None, # pylint:disable=R0913
|
||||
- kernel='3.10.0-957.43.1.el7.x86_64',
|
||||
- release_id='rhel', src_ver='8.10', dst_ver='9.6', msgs=None, flavour='default', config=None,
|
||||
- virtual_source_version=None, virtual_target_version=None,
|
||||
- supported_upgrade_paths=None):
|
||||
+
|
||||
+ def __init__( # pylint: disable=too-many-arguments
|
||||
+ self,
|
||||
+ arch=architecture.ARCH_X86_64,
|
||||
+ envars=None, # pylint:disable=R0913
|
||||
+ kernel="3.10.0-957.43.1.el7.x86_64",
|
||||
+ release_id="rhel",
|
||||
+ src_ver="8.10",
|
||||
+ dst_ver="9.6",
|
||||
+ msgs=None,
|
||||
+ flavour="default",
|
||||
+ config=None,
|
||||
+ virtual_source_version=None,
|
||||
+ virtual_target_version=None,
|
||||
+ supported_upgrade_paths=None,
|
||||
+ src_distro=None,
|
||||
+ dst_distro=None,
|
||||
+ ):
|
||||
"""
|
||||
+ Note: src_distro and release_id specify the same thing, but src_distro takes priority.
|
||||
+
|
||||
:param List[IPUSourceToPossibleTargets] supported_upgrade_paths: List of supported upgrade paths.
|
||||
"""
|
||||
envarsList = [EnvVar(name=k, value=v) for k, v in envars.items()] if envars else []
|
||||
@@ -92,7 +107,11 @@ class CurrentActorMocked: # pylint:disable=R0904
|
||||
version_values = [src_ver, dst_ver, virtual_source_version or src_ver, virtual_target_version or dst_ver]
|
||||
version = namedtuple('Version', version_fields)(*version_values)
|
||||
|
||||
- release = namedtuple('OS_release', ['release_id', 'version_id'])(release_id, src_ver)
|
||||
+ release = namedtuple('OS_release', ['release_id', 'version_id'])(src_distro or release_id, src_ver)
|
||||
+
|
||||
+ distro = namedtuple("Distro", ["source", "target"])(
|
||||
+ src_distro or release_id, dst_distro or release_id
|
||||
+ )
|
||||
|
||||
self._common_folder = '../../files'
|
||||
self._common_tools_folder = '../../tools'
|
||||
@@ -103,9 +122,18 @@ class CurrentActorMocked: # pylint:disable=R0904
|
||||
supported_upgrade_paths = [IPUSourceToPossibleTargets(source_version=src_ver, target_versions=[dst_ver])]
|
||||
|
||||
ipu_conf_fields = ['architecture', 'kernel', 'leapp_env_vars', 'os_release',
|
||||
- 'version', 'flavour', 'supported_upgrade_paths']
|
||||
+ 'version', 'flavour', 'supported_upgrade_paths', 'distro']
|
||||
config_type = namedtuple('configuration', ipu_conf_fields)
|
||||
- self.configuration = config_type(arch, kernel, envarsList, release, version, flavour, supported_upgrade_paths)
|
||||
+ self.configuration = config_type(
|
||||
+ arch,
|
||||
+ kernel,
|
||||
+ envarsList,
|
||||
+ release,
|
||||
+ version,
|
||||
+ flavour,
|
||||
+ supported_upgrade_paths,
|
||||
+ distro,
|
||||
+ )
|
||||
|
||||
self._msgs = msgs or []
|
||||
self.config = {} if config is None else config
|
||||
diff --git a/repos/system_upgrade/common/models/ipuconfig.py b/repos/system_upgrade/common/models/ipuconfig.py
|
||||
index 379ac13f..a787e4d5 100644
|
||||
--- a/repos/system_upgrade/common/models/ipuconfig.py
|
||||
+++ b/repos/system_upgrade/common/models/ipuconfig.py
|
||||
@@ -64,6 +64,16 @@ class IPUSourceToPossibleTargets(Model):
|
||||
"""List of defined target system versions for the `source_version` system."""
|
||||
|
||||
|
||||
+class Distro(Model):
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ source = fields.String()
|
||||
+ """Release id of the source system (e.g. rhel, centos, almalinux)."""
|
||||
+
|
||||
+ target = fields.String()
|
||||
+ """Release id of the target system (e.g. rhel, centos, almalinux)."""
|
||||
+
|
||||
+
|
||||
class IPUConfig(Model):
|
||||
"""
|
||||
IPU workflow configuration model
|
||||
@@ -96,3 +106,6 @@ class IPUConfig(Model):
|
||||
|
||||
The list contains only upgrade paths for the `flavour` of the source system.
|
||||
"""
|
||||
+
|
||||
+ distro = fields.Model(Distro)
|
||||
+ """Release IDs of the source and target system."""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,125 +0,0 @@
|
||||
From e32668ccc0320a02e3f48a76edcb0896545ab492 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 15 Sep 2025 16:59:27 +0200
|
||||
Subject: [PATCH 59/69] ipuconfig: Allow for one of the virtual version to be
|
||||
missing
|
||||
|
||||
This is required for conversions.
|
||||
|
||||
The existing error message was improved to contain the key that is
|
||||
actually missing in the virtual versions map.
|
||||
|
||||
Jira: RHEL-110563
|
||||
---
|
||||
.../libraries/ipuworkflowconfig.py | 50 +++++++++----------
|
||||
.../tests/test_ipuworkflowconfig.py | 11 ++--
|
||||
2 files changed, 30 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
index dd84f3a1..afc139a1 100644
|
||||
--- a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
@@ -117,9 +117,9 @@ def construct_models_for_paths_matching_source_major(raw_paths, src_major_versio
|
||||
return multipaths_matching_source
|
||||
|
||||
|
||||
-def construct_virtual_versions(all_upgrade_path_defs, distro_id, source_version, target_version):
|
||||
- if distro_id.lower() != 'centos':
|
||||
- return (source_version, target_version)
|
||||
+def construct_virtual_version(all_upgrade_path_defs, distro, version):
|
||||
+ if distro.lower() != 'centos':
|
||||
+ return version
|
||||
|
||||
centos_upgrade_paths = all_upgrade_path_defs.get('centos', {})
|
||||
if not centos_upgrade_paths:
|
||||
@@ -127,27 +127,24 @@ def construct_virtual_versions(all_upgrade_path_defs, distro_id, source_version,
|
||||
|
||||
virtual_versions = centos_upgrade_paths.get(CENTOS_VIRTUAL_VERSIONS_KEY, {})
|
||||
if not virtual_versions: # Unlikely, only if using old upgrade_paths.json, but the user should not touch the file
|
||||
- details = {'details': 'The file does not contain any information about virtual versions of CentOS'}
|
||||
- raise StopActorExecutionError('The internal upgrade_paths.json file is malformed.')
|
||||
-
|
||||
- source_virtual_version = virtual_versions.get(source_version)
|
||||
- target_virtual_version = virtual_versions.get(target_version)
|
||||
-
|
||||
- if not source_virtual_version or not target_virtual_version:
|
||||
- if not source_virtual_version and not target_virtual_version:
|
||||
- what_is_missing = 'CentOS {} (source) and CentOS {} (target)'.format(source_virtual_version,
|
||||
- target_virtual_version)
|
||||
- elif not source_virtual_version:
|
||||
- what_is_missing = 'CentOS {} (source)'.format(source_virtual_version)
|
||||
- else:
|
||||
- what_is_missing = 'CentOS {} (target)'.format(target_virtual_version)
|
||||
-
|
||||
- details_msg = 'The {} field in upgrade path definitions does not provide any information for {}'
|
||||
- details = {'details': details_msg.format(CENTOS_VIRTUAL_VERSIONS_KEY, what_is_missing)}
|
||||
- raise StopActorExecutionError('Failed to identify virtual minor version number for the system.',
|
||||
- details=details)
|
||||
+ details = {
|
||||
+ "details": "The file does not contain any information about virtual versions of CentOS"
|
||||
+ }
|
||||
+ raise StopActorExecutionError(
|
||||
+ "The internal upgrade_paths.json file is invalid.", details=details
|
||||
+ )
|
||||
|
||||
- return (source_virtual_version, target_virtual_version)
|
||||
+ virtual_version = virtual_versions.get(version)
|
||||
+ if not virtual_version:
|
||||
+ details = (
|
||||
+ 'The {} field in upgrade path definitions for \'centos\' does not'
|
||||
+ ' provide any virtual version for version {}'
|
||||
+ ).format(CENTOS_VIRTUAL_VERSIONS_KEY, version)
|
||||
+ raise StopActorExecutionError(
|
||||
+ "Failed to identify virtual minor version number for the system.",
|
||||
+ details={"details": details},
|
||||
+ )
|
||||
+ return virtual_version
|
||||
|
||||
|
||||
def produce_ipu_config(actor):
|
||||
@@ -165,12 +162,11 @@ def produce_ipu_config(actor):
|
||||
source_major_version = source_version.split('.')[0]
|
||||
exposed_supported_paths = construct_models_for_paths_matching_source_major(raw_upgrade_paths, source_major_version)
|
||||
|
||||
- virtual_source_version, virtual_target_version = construct_virtual_versions(all_upgrade_path_defs,
|
||||
- os_release.release_id,
|
||||
- source_version,
|
||||
- target_version)
|
||||
target_distro = os.environ.get('LEAPP_TARGET_OS')
|
||||
|
||||
+ virtual_source_version = construct_virtual_version(all_upgrade_path_defs, os_release.release_id, source_version)
|
||||
+ virtual_target_version = construct_virtual_version(all_upgrade_path_defs, target_distro, target_version)
|
||||
+
|
||||
actor.produce(IPUConfig(
|
||||
leapp_env_vars=get_env_vars(),
|
||||
os_release=os_release,
|
||||
diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
index 8b7faffb..96b63666 100644
|
||||
--- a/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
@@ -171,9 +171,12 @@ def test_load_raw_upgrade_paths_for_distro_and_flavour(monkeypatch, distro, flav
|
||||
@pytest.mark.parametrize(
|
||||
('construction_params', 'expected_versions'),
|
||||
[
|
||||
- (('centos', '8', '9'), ('8.10', '9.5')),
|
||||
- (('rhel', '8.10', '9.4'), ('8.10', '9.4')),
|
||||
- (('almalinux', '8.10', '9.6'), ('8.10', '9.6')),
|
||||
+ (('centos', '8'), '8.10'),
|
||||
+ (('centos', '9'), '9.5'),
|
||||
+ (('rhel', '8.10'), '8.10'),
|
||||
+ (('rhel', '9.4'), '9.4'),
|
||||
+ (('almalinux', '8.10'), '8.10'),
|
||||
+ (('almalinux', '9.6'), '9.6'),
|
||||
]
|
||||
)
|
||||
def test_virtual_version_construction(construction_params, expected_versions):
|
||||
@@ -208,5 +211,5 @@ def test_virtual_version_construction(construction_params, expected_versions):
|
||||
},
|
||||
}
|
||||
|
||||
- result = ipuworkflowconfig.construct_virtual_versions(defined_upgrade_paths, *construction_params)
|
||||
+ result = ipuworkflowconfig.construct_virtual_version(defined_upgrade_paths, *construction_params)
|
||||
assert result == expected_versions
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,345 +0,0 @@
|
||||
From 37f6e616843a9441a6a79fecbffa94c238d987aa Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 18 Sep 2025 19:12:41 +0200
|
||||
Subject: [PATCH 60/69] ipuconfig: Map source to target distro paths when
|
||||
converting
|
||||
|
||||
Jira: RHEL-110563
|
||||
---
|
||||
.../libraries/ipuworkflowconfig.py | 112 +++++++++++-----
|
||||
.../tests/test_ipuworkflowconfig.py | 123 ++++++++++++------
|
||||
2 files changed, 167 insertions(+), 68 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
index afc139a1..0c05640a 100644
|
||||
--- a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
@@ -93,31 +93,7 @@ def load_upgrade_paths_definitions(paths_definition_file):
|
||||
return definitions
|
||||
|
||||
|
||||
-def extract_upgrade_paths_for_distro_and_flavour(all_definitions, distro_id, flavour):
|
||||
- raw_upgrade_paths_for_distro = all_definitions.get(distro_id, {})
|
||||
-
|
||||
- if not raw_upgrade_paths_for_distro:
|
||||
- api.current_logger().warning('No upgrade paths defined for distro \'{}\''.format(distro_id))
|
||||
-
|
||||
- raw_upgrade_paths_for_flavour = raw_upgrade_paths_for_distro.get(flavour, {})
|
||||
-
|
||||
- if not raw_upgrade_paths_for_flavour:
|
||||
- api.current_logger().warning('Cannot discover any upgrade paths for flavour: {}/{}'.format(distro_id, flavour))
|
||||
-
|
||||
- return raw_upgrade_paths_for_flavour
|
||||
-
|
||||
-
|
||||
-def construct_models_for_paths_matching_source_major(raw_paths, src_major_version):
|
||||
- multipaths_matching_source = []
|
||||
- for src_version, target_versions in raw_paths.items():
|
||||
- if src_version.split('.')[0] == src_major_version:
|
||||
- source_to_targets = IPUSourceToPossibleTargets(source_version=src_version,
|
||||
- target_versions=target_versions)
|
||||
- multipaths_matching_source.append(source_to_targets)
|
||||
- return multipaths_matching_source
|
||||
-
|
||||
-
|
||||
-def construct_virtual_version(all_upgrade_path_defs, distro, version):
|
||||
+def get_virtual_version(all_upgrade_path_defs, distro, version):
|
||||
if distro.lower() != 'centos':
|
||||
return version
|
||||
|
||||
@@ -147,11 +123,78 @@ def construct_virtual_version(all_upgrade_path_defs, distro, version):
|
||||
return virtual_version
|
||||
|
||||
|
||||
+def extract_upgrade_paths_for_distro_and_flavour(all_definitions, distro, flavour):
|
||||
+ distro_paths = all_definitions.get(distro, {})
|
||||
+ if not distro_paths:
|
||||
+ api.current_logger().warning(
|
||||
+ "No upgrade paths defined for distro '{}'".format(distro)
|
||||
+ )
|
||||
+
|
||||
+ distro_paths = distro_paths.get(flavour, {})
|
||||
+ if not distro_paths:
|
||||
+ api.current_logger().warning(
|
||||
+ "Cannot discover any upgrade paths for flavour: {}/{}".format(
|
||||
+ distro, flavour
|
||||
+ )
|
||||
+ )
|
||||
+ return distro_paths
|
||||
+
|
||||
+
|
||||
+def make_cross_distro_paths(all_paths, source_distro, target_distro, flavour):
|
||||
+ """
|
||||
+ Make paths for upgrade + conversion.
|
||||
+
|
||||
+ :param all_paths: The raw upgrade paths retrieved from upgrade_paths.json
|
||||
+ :type all_paths: dict
|
||||
+ :param source_distro: The source distro.
|
||||
+ :type source_distro: str
|
||||
+ :param target_distro: The target distro.
|
||||
+ :type target_distro: str
|
||||
+ :param flavour: The flavour to find paths for.
|
||||
+ :type target_distro: str
|
||||
+ :return: A dictionary with conversion paths for upgrade + conversion between
|
||||
+ source and target distro.
|
||||
+ :rtype: dict
|
||||
+ """
|
||||
+ # using source and target for both distro and version gets confusing, using
|
||||
+ # a and b for distro instead
|
||||
+ paths_a = extract_upgrade_paths_for_distro_and_flavour(
|
||||
+ all_paths, source_distro, flavour
|
||||
+ )
|
||||
+ paths_b = extract_upgrade_paths_for_distro_and_flavour(
|
||||
+ all_paths, target_distro, flavour
|
||||
+ )
|
||||
+
|
||||
+ conversion_paths = {}
|
||||
+ for source_ver_a, _ in paths_a.items():
|
||||
+ virt_source_ver_a = get_virtual_version(all_paths, source_distro, source_ver_a)
|
||||
+
|
||||
+ for source_ver_b, target_ver_b in paths_b.items():
|
||||
+ virt_source_ver_b = get_virtual_version(all_paths, target_distro, source_ver_b)
|
||||
+ if virt_source_ver_a == virt_source_ver_b:
|
||||
+ conversion_paths[source_ver_a] = target_ver_b
|
||||
+
|
||||
+ return conversion_paths
|
||||
+
|
||||
+
|
||||
+def construct_models_for_paths_matching_source_major(
|
||||
+ raw_paths, src_major_version
|
||||
+):
|
||||
+ multipaths_matching_source = []
|
||||
+ for src_version, target_versions in raw_paths.items():
|
||||
+ if src_version.split('.')[0] == src_major_version:
|
||||
+ source_to_targets = IPUSourceToPossibleTargets(source_version=src_version,
|
||||
+ target_versions=target_versions)
|
||||
+ multipaths_matching_source.append(source_to_targets)
|
||||
+ return multipaths_matching_source
|
||||
+
|
||||
+
|
||||
def produce_ipu_config(actor):
|
||||
flavour = os.environ.get('LEAPP_UPGRADE_PATH_FLAVOUR')
|
||||
target_version = os.environ.get('LEAPP_UPGRADE_PATH_TARGET_RELEASE')
|
||||
os_release = get_os_release('/etc/os-release')
|
||||
source_version = os_release.version_id
|
||||
+ target_distro = os.environ.get('LEAPP_TARGET_OS')
|
||||
|
||||
check_target_major_version(source_version, target_version)
|
||||
|
||||
@@ -159,13 +202,22 @@ def produce_ipu_config(actor):
|
||||
raw_upgrade_paths = extract_upgrade_paths_for_distro_and_flavour(all_upgrade_path_defs,
|
||||
os_release.release_id,
|
||||
flavour)
|
||||
- source_major_version = source_version.split('.')[0]
|
||||
- exposed_supported_paths = construct_models_for_paths_matching_source_major(raw_upgrade_paths, source_major_version)
|
||||
+ if os_release.release_id == target_distro:
|
||||
+ raw_upgrade_paths = extract_upgrade_paths_for_distro_and_flavour(
|
||||
+ all_upgrade_path_defs, os_release.release_id, flavour
|
||||
+ )
|
||||
+ else:
|
||||
+ raw_upgrade_paths = make_cross_distro_paths(
|
||||
+ all_upgrade_path_defs, os_release.release_id, target_distro, flavour
|
||||
+ )
|
||||
|
||||
- target_distro = os.environ.get('LEAPP_TARGET_OS')
|
||||
+ virtual_source_version = get_virtual_version(all_upgrade_path_defs, os_release.release_id, source_version)
|
||||
+ virtual_target_version = get_virtual_version(all_upgrade_path_defs, target_distro, target_version)
|
||||
|
||||
- virtual_source_version = construct_virtual_version(all_upgrade_path_defs, os_release.release_id, source_version)
|
||||
- virtual_target_version = construct_virtual_version(all_upgrade_path_defs, target_distro, target_version)
|
||||
+ source_major_version = source_version.split('.')[0]
|
||||
+ exposed_supported_paths = construct_models_for_paths_matching_source_major(
|
||||
+ raw_upgrade_paths, source_major_version
|
||||
+ )
|
||||
|
||||
actor.produce(IPUConfig(
|
||||
leapp_env_vars=get_env_vars(),
|
||||
diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
index 96b63666..c0deaf0e 100644
|
||||
--- a/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
@@ -1,6 +1,4 @@
|
||||
-import json
|
||||
import os
|
||||
-import tempfile
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -42,6 +40,43 @@ def _get_os_release(version='7.9', codename='Maipo'):
|
||||
return release
|
||||
|
||||
|
||||
+TEST_UPGRADE_PATHS = {
|
||||
+ 'rhel': {
|
||||
+ 'default': {
|
||||
+ '8.10': ['9.4', '9.6', '9.7'],
|
||||
+ '8.4': ['9.2'],
|
||||
+ '9.6': ['10.0'],
|
||||
+ '9.7': ['10.1'],
|
||||
+ '8': ['9.4', '9.6'],
|
||||
+ '9': ['10.1'],
|
||||
+ },
|
||||
+ 'saphana': {
|
||||
+ '8.10': ['9.6', '9.4'],
|
||||
+ '8': ['9.6', '9.4'],
|
||||
+ '9.6': ['10.0'],
|
||||
+ '9': ['10.0'],
|
||||
+ },
|
||||
+ },
|
||||
+ 'centos': {
|
||||
+ 'default': {
|
||||
+ '8': ['9'],
|
||||
+ '9': ['10'],
|
||||
+ },
|
||||
+ '_virtual_versions': {
|
||||
+ '8': '8.10',
|
||||
+ '9': '9.7',
|
||||
+ '10': '10.1',
|
||||
+ },
|
||||
+ },
|
||||
+ 'almalinux': {
|
||||
+ 'default': {
|
||||
+ '8.10': ['9.0', '9.1', '9.2', '9.3', '9.4', '9.5', '9.6', '9.7'],
|
||||
+ '9.7': ['10.0', '10.1'],
|
||||
+ },
|
||||
+ },
|
||||
+}
|
||||
+
|
||||
+
|
||||
def test_leapp_env_vars(monkeypatch):
|
||||
_clean_leapp_envs(monkeypatch)
|
||||
monkeypatch.setenv('LEAPP_WHATEVER', '0')
|
||||
@@ -82,6 +117,7 @@ def test_get_booted_kernel(monkeypatch):
|
||||
IPUSourceToPossibleTargets(source_version='8.10', target_versions=['9.4', '9.5', '9.6']),
|
||||
IPUSourceToPossibleTargets(source_version='8.4', target_versions=['9.2']),
|
||||
IPUSourceToPossibleTargets(source_version='8', target_versions=['9.4', '9.5', '9.6']),
|
||||
+ IPUSourceToPossibleTargets(source_version='8.6', target_versions=['9']),
|
||||
]
|
||||
),
|
||||
(
|
||||
@@ -90,6 +126,13 @@ def test_get_booted_kernel(monkeypatch):
|
||||
IPUSourceToPossibleTargets(source_version='80.0', target_versions=['81.0']),
|
||||
]
|
||||
),
|
||||
+ (
|
||||
+ '9',
|
||||
+ [
|
||||
+ IPUSourceToPossibleTargets(source_version='9', target_versions=['10']),
|
||||
+ IPUSourceToPossibleTargets(source_version='9.6', target_versions=['10.0']),
|
||||
+ ]
|
||||
+ ),
|
||||
)
|
||||
)
|
||||
def test_construct_models_for_paths_matching_source_major(source_major_version, expected_result):
|
||||
@@ -98,7 +141,9 @@ def test_construct_models_for_paths_matching_source_major(source_major_version,
|
||||
'8.4': ['9.2'],
|
||||
'9.6': ['10.0'],
|
||||
'8': ['9.4', '9.5', '9.6'],
|
||||
- '80.0': ['81.0']
|
||||
+ '80.0': ['81.0'],
|
||||
+ '8.6': ['9'],
|
||||
+ '9': ['10'],
|
||||
}
|
||||
|
||||
result = ipuworkflowconfig.construct_models_for_paths_matching_source_major(RAW_PATHS, source_major_version)
|
||||
@@ -106,6 +151,38 @@ def test_construct_models_for_paths_matching_source_major(source_major_version,
|
||||
assert result == sorted(expected_result, key=lambda x: x.source_version)
|
||||
|
||||
|
||||
+@pytest.mark.parametrize(
|
||||
+ "src_distro,dst_distro,expected",
|
||||
+ [
|
||||
+ ("centos", "rhel", {"8": ["9.4", "9.6", "9.7"], "9": ["10.1"]}),
|
||||
+ ("almalinux", "rhel", {"8.10": ["9.4", "9.6", "9.7"], "9.7": ["10.1"]}),
|
||||
+ ("rhel", "centos", {"8.10": ["9"], "9.7": ["10"]}),
|
||||
+ ("almalinux", "centos", {"8.10": ["9"], "9.7": ["10"]}),
|
||||
+ (
|
||||
+ "rhel",
|
||||
+ "almalinux",
|
||||
+ {
|
||||
+ "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7"],
|
||||
+ "9.7": ["10.0", "10.1"],
|
||||
+ },
|
||||
+ ),
|
||||
+ (
|
||||
+ "centos",
|
||||
+ "almalinux",
|
||||
+ {
|
||||
+ "8": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7"],
|
||||
+ "9": ["10.0", "10.1"],
|
||||
+ },
|
||||
+ ),
|
||||
+ ],
|
||||
+)
|
||||
+def test_make_cross_distro_paths(src_distro, dst_distro, expected):
|
||||
+ res = ipuworkflowconfig.make_cross_distro_paths(
|
||||
+ TEST_UPGRADE_PATHS, src_distro, dst_distro, 'default'
|
||||
+ )
|
||||
+ assert res == expected
|
||||
+
|
||||
+
|
||||
@pytest.mark.parametrize(
|
||||
('distro', 'flavour', 'expected_result'),
|
||||
(
|
||||
@@ -163,8 +240,9 @@ def test_load_raw_upgrade_paths_for_distro_and_flavour(monkeypatch, distro, flav
|
||||
}
|
||||
}
|
||||
|
||||
- result = ipuworkflowconfig.extract_upgrade_paths_for_distro_and_flavour(defined_upgrade_paths,
|
||||
- distro, flavour)
|
||||
+ result = ipuworkflowconfig.extract_upgrade_paths_for_distro_and_flavour(
|
||||
+ defined_upgrade_paths, distro, flavour
|
||||
+ )
|
||||
assert result == expected_result
|
||||
|
||||
|
||||
@@ -172,7 +250,7 @@ def test_load_raw_upgrade_paths_for_distro_and_flavour(monkeypatch, distro, flav
|
||||
('construction_params', 'expected_versions'),
|
||||
[
|
||||
(('centos', '8'), '8.10'),
|
||||
- (('centos', '9'), '9.5'),
|
||||
+ (('centos', '9'), '9.7'),
|
||||
(('rhel', '8.10'), '8.10'),
|
||||
(('rhel', '9.4'), '9.4'),
|
||||
(('almalinux', '8.10'), '8.10'),
|
||||
@@ -180,36 +258,5 @@ def test_load_raw_upgrade_paths_for_distro_and_flavour(monkeypatch, distro, flav
|
||||
]
|
||||
)
|
||||
def test_virtual_version_construction(construction_params, expected_versions):
|
||||
- defined_upgrade_paths = {
|
||||
- 'rhel': {
|
||||
- 'default': {
|
||||
- '8.10': ['9.4', '9.5', '9.6'],
|
||||
- '8.4': ['9.2'],
|
||||
- '9.6': ['10.0'],
|
||||
- '8': ['9.4', '9.5', '9.6'],
|
||||
- '9': ['10.0']
|
||||
- },
|
||||
- 'saphana': {
|
||||
- '8.10': ['9.6', '9.4'],
|
||||
- '8': ['9.6', '9.4'],
|
||||
- '9.6': ['10.0'],
|
||||
- '9': ['10.0']
|
||||
- }
|
||||
- },
|
||||
- 'centos': {
|
||||
- '8': ['9'],
|
||||
- '_virtual_versions': {
|
||||
- '8': '8.10',
|
||||
- '9': '9.5',
|
||||
- }
|
||||
- },
|
||||
- 'almalinux': {
|
||||
- 'default': {
|
||||
- '8.10': ['9.0', '9.1', '9.2', '9.3', '9.4', '9.5', '9.6'],
|
||||
- '9.6': ['10.0']
|
||||
- }
|
||||
- },
|
||||
- }
|
||||
-
|
||||
- result = ipuworkflowconfig.construct_virtual_version(defined_upgrade_paths, *construction_params)
|
||||
+ result = ipuworkflowconfig.get_virtual_version(TEST_UPGRADE_PATHS, *construction_params)
|
||||
assert result == expected_versions
|
||||
--
|
||||
2.51.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,40 +0,0 @@
|
||||
From fbb7cda3ea9c41a42cce7e6f24c6baa66cd9f9e0 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 18 Sep 2025 20:21:47 +0200
|
||||
Subject: [PATCH 62/69] lib/version: Also peform version correction when target
|
||||
is centos
|
||||
|
||||
Currently the version "autocorrection" is performed only when the source
|
||||
system is centos, however we might get a major only version even when
|
||||
the source doesn't use them and the target does. For example when
|
||||
matching whether a version is between source and target version as is
|
||||
done in peseventsscanner.
|
||||
|
||||
Jira: RHEL-110563
|
||||
---
|
||||
repos/system_upgrade/common/libraries/config/version.py | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/version.py b/repos/system_upgrade/common/libraries/config/version.py
|
||||
index 5efa932d..84cbd753 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/version.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/version.py
|
||||
@@ -198,9 +198,12 @@ def matches_version(match_list, detected):
|
||||
raise TypeError("Detected version has to be a string "
|
||||
"but provided was {}: '{}'".format(type(detected), detected))
|
||||
|
||||
- # If we are on CentOS, and we are provided with a version of the form MAJOR, try to correct
|
||||
- # the version into MAJOR.MINOR using virtual versions
|
||||
- if api.current_actor().configuration.os_release.release_id == 'centos':
|
||||
+ # If we are on CentOS, or the target is CentOS and we are provided with a
|
||||
+ # version of the form MAJOR, try to correct the version into MAJOR.MINOR
|
||||
+ # using virtual versions
|
||||
+ # Cannot use get_source_distro_id and get_target_distro_id here because of circular imports
|
||||
+ distro_config = api.current_actor().configuration.distro
|
||||
+ if distro_config.source == 'centos' or distro_config.target == 'centos':
|
||||
new_detected = _autocorrect_centos_version(detected)
|
||||
# We might have a matchlist ['> 8', '<= 9'] that, e.g., results from blindly using source/target versions
|
||||
# to make a matchlist. Our `detected` version might be some fixed string, e.g., `9.1`. So we need to
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,116 +0,0 @@
|
||||
From f688fbfc7fa500a43dc6cdc33356bc14bfbca964 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 13 Nov 2025 13:00:05 +0100
|
||||
Subject: [PATCH 63/69] Add --target-os CLI option
|
||||
|
||||
The option specifies the target OS (distribution) to upgrade to. This
|
||||
sets the value of LEAPP_TARGET_OS, however LEAPP_DEVEL_TARGET_OS has
|
||||
precedence. If none of the envars are defined, default to the source
|
||||
distro i.e. only upgrade, no conversion, will be performed.
|
||||
|
||||
The available options are 'rhel', 'centos' and 'almalinux'.
|
||||
Note that the "ID" value from /etc/os-release is used and therefore
|
||||
'centos' really refers to Centos Stream.
|
||||
|
||||
Jira: RHEL-110563
|
||||
---
|
||||
commands/command_utils.py | 6 +++++-
|
||||
commands/preupgrade/__init__.py | 7 +++++++
|
||||
commands/tests/test_upgrade_paths.py | 2 +-
|
||||
commands/upgrade/__init__.py | 7 +++++++
|
||||
commands/upgrade/util.py | 9 ++++++---
|
||||
5 files changed, 26 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/commands/command_utils.py b/commands/command_utils.py
|
||||
index 31125da5..45a949fc 100644
|
||||
--- a/commands/command_utils.py
|
||||
+++ b/commands/command_utils.py
|
||||
@@ -136,7 +136,7 @@ def get_os_release_version_id(filepath):
|
||||
return _retrieve_os_release_contents(_os_release_path=filepath).get('VERSION_ID', '')
|
||||
|
||||
|
||||
-def get_distro_id():
|
||||
+def get_source_distro_id():
|
||||
"""
|
||||
Retrieve the OS release ID from /etc/os-release.
|
||||
|
||||
@@ -302,3 +302,7 @@ def load_actor_configs_and_store_it_in_db(context, repositories, framework_cfg):
|
||||
config_data = audit.ActorConfigData(config=config_text, hash_id=config_text_hash)
|
||||
db_config = audit.ActorConfig(config=config_data, context=context)
|
||||
db_config.store()
|
||||
+
|
||||
+
|
||||
+def get_available_target_distro_ids():
|
||||
+ return [member.value for member in DistroIDs]
|
||||
diff --git a/commands/preupgrade/__init__.py b/commands/preupgrade/__init__.py
|
||||
index f24e779a..33f11ba2 100644
|
||||
--- a/commands/preupgrade/__init__.py
|
||||
+++ b/commands/preupgrade/__init__.py
|
||||
@@ -38,6 +38,13 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
@command_opt('iso', help='Use provided target RHEL installation image to perform the in-place upgrade.')
|
||||
@command_opt('target', help='Specify RHEL version to upgrade to for {} detected upgrade flavour'.format(
|
||||
command_utils.get_upgrade_flavour()))
|
||||
+@command_opt(
|
||||
+ 'target-os',
|
||||
+ help='Specify the OS to upgrade to. If this differs from the OS on the'
|
||||
+ ' source system, a conversion is performed during the upgrade.',
|
||||
+ choices=command_utils.get_available_target_distro_ids(),
|
||||
+ default=command_utils.get_source_distro_id(),
|
||||
+)
|
||||
@command_opt('report-schema', help='Specify report schema version for leapp-report.json',
|
||||
choices=['1.0.0', '1.1.0', '1.2.0'], default=get_config().get('report', 'schema'))
|
||||
@command_opt('nogpgcheck', is_flag=True, help='Disable RPM GPG checks. Same as yum/dnf --nogpgcheck option.')
|
||||
diff --git a/commands/tests/test_upgrade_paths.py b/commands/tests/test_upgrade_paths.py
|
||||
index 95e6519a..59c8ac36 100644
|
||||
--- a/commands/tests/test_upgrade_paths.py
|
||||
+++ b/commands/tests/test_upgrade_paths.py
|
||||
@@ -79,7 +79,7 @@ def test_get_target_release(mock_open, monkeypatch): # do not remove mock_open
|
||||
# assumes.
|
||||
# Otherwise the test, when ran on Centos, fails because it works
|
||||
# with MAJOR.MINOR version format while Centos uses MAJOR format.
|
||||
- monkeypatch.setattr(command_utils, 'get_distro_id', lambda: 'rhel')
|
||||
+ monkeypatch.setattr(command_utils, 'get_source_distro_id', lambda: 'rhel')
|
||||
monkeypatch.setattr(command_utils, 'get_os_release_version_id', lambda x: '8.6')
|
||||
|
||||
# make sure env var LEAPP_DEVEL_TARGET_RELEASE takes precedence
|
||||
diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py
|
||||
index c5900c0d..670a2e7b 100644
|
||||
--- a/commands/upgrade/__init__.py
|
||||
+++ b/commands/upgrade/__init__.py
|
||||
@@ -44,6 +44,13 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
@command_opt('iso', help='Use provided target RHEL installation image to perform the in-place upgrade.')
|
||||
@command_opt('target', help='Specify RHEL version to upgrade to for {} detected upgrade flavour'.format(
|
||||
command_utils.get_upgrade_flavour()))
|
||||
+@command_opt(
|
||||
+ 'target-os',
|
||||
+ help='Specify the OS to upgrade to. If this differs from the OS on the'
|
||||
+ ' source system, a conversion is performed during the upgrade.',
|
||||
+ choices=command_utils.get_available_target_distro_ids(),
|
||||
+ default=command_utils.get_source_distro_id(),
|
||||
+)
|
||||
@command_opt('report-schema', help='Specify report schema version for leapp-report.json',
|
||||
choices=['1.0.0', '1.1.0', '1.2.0'], default=get_config().get('report', 'schema'))
|
||||
@command_opt('nogpgcheck', is_flag=True, help='Disable RPM GPG checks. Same as yum/dnf --nogpgcheck option.')
|
||||
diff --git a/commands/upgrade/util.py b/commands/upgrade/util.py
|
||||
index 1c88eab8..da319448 100644
|
||||
--- a/commands/upgrade/util.py
|
||||
+++ b/commands/upgrade/util.py
|
||||
@@ -221,9 +221,12 @@ def prepare_configuration(args):
|
||||
if args.enable_experimental_feature:
|
||||
os.environ['LEAPP_EXPERIMENTAL'] = '1'
|
||||
|
||||
- os.environ["LEAPP_TARGET_OS"] = os.getenv(
|
||||
- "LEAPP_DEVEL_TARGET_OS", command_utils.get_distro_id()
|
||||
- )
|
||||
+ if os.getenv('LEAPP_DEVEL_TARGET_OS'):
|
||||
+ os.environ['LEAPP_TARGET_OS'] = os.environ['LEAPP_DEVEL_TARGET_OS']
|
||||
+ elif args.target_os:
|
||||
+ os.environ['LEAPP_TARGET_OS'] = args.target_os
|
||||
+ else:
|
||||
+ os.environ["LEAPP_TARGET_OS"] = command_utils.get_source_distro_id()
|
||||
|
||||
os.environ['LEAPP_UNSUPPORTED'] = '0' if os.getenv('LEAPP_UNSUPPORTED', '0') == '0' else '1'
|
||||
# force no rhsm on non-rhel systems, regardless of whether the binary is there
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,140 +0,0 @@
|
||||
From 2df44df07819d8b1e6aaba06534d38fdcc244335 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 19 Sep 2025 11:37:10 +0200
|
||||
Subject: [PATCH 64/69] Add --target-version as an alias for the --target
|
||||
option
|
||||
|
||||
With the introduction of --target-os option, the --target option is a
|
||||
bit ambiguous, therefore --target-version is added as an alias.
|
||||
|
||||
The leapp-framework dependency version is bumped from 6.1 to 6.2,
|
||||
because 6.2 introduces the ability to add an alias to an option.
|
||||
|
||||
Jira: RHEL-110563
|
||||
---
|
||||
commands/command_utils.py | 6 +++---
|
||||
commands/preupgrade/__init__.py | 10 ++++++++--
|
||||
commands/tests/test_upgrade_paths.py | 8 ++++----
|
||||
commands/upgrade/__init__.py | 10 ++++++++--
|
||||
packaging/leapp-repository.spec | 2 +-
|
||||
5 files changed, 24 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/commands/command_utils.py b/commands/command_utils.py
|
||||
index 45a949fc..735144f8 100644
|
||||
--- a/commands/command_utils.py
|
||||
+++ b/commands/command_utils.py
|
||||
@@ -215,8 +215,8 @@ def get_target_release(args):
|
||||
Return the user selected target release or choose one from config.
|
||||
|
||||
A target release can be specified, ordered by priority, by the
|
||||
- LEAPP_DEVEL_TARGET_RELEASE or args.target (--target cmdline arg) or in the
|
||||
- config file.
|
||||
+ LEAPP_DEVEL_TARGET_RELEASE or args.target_version (--target cmdline arg) or
|
||||
+ in the config file.
|
||||
|
||||
NOTE: when specified via the env var or cmdline arg, the version isn't
|
||||
checked against supported versions, this is done later by an actor in the
|
||||
@@ -227,7 +227,7 @@ def get_target_release(args):
|
||||
flavor = get_upgrade_flavour()
|
||||
env_version_override = os.getenv('LEAPP_DEVEL_TARGET_RELEASE')
|
||||
|
||||
- target_ver = env_version_override or args.target
|
||||
+ target_ver = env_version_override or args.target_version
|
||||
target_distro_id = os.getenv('LEAPP_TARGET_OS')
|
||||
if target_ver:
|
||||
expected_version_format = _DISTRO_VERSION_FORMATS.get(
|
||||
diff --git a/commands/preupgrade/__init__.py b/commands/preupgrade/__init__.py
|
||||
index 33f11ba2..29b10c0f 100644
|
||||
--- a/commands/preupgrade/__init__.py
|
||||
+++ b/commands/preupgrade/__init__.py
|
||||
@@ -36,8 +36,14 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
choices=['ga', 'e4s', 'eus', 'aus'],
|
||||
value_type=str.lower) # This allows the choices to be case insensitive
|
||||
@command_opt('iso', help='Use provided target RHEL installation image to perform the in-place upgrade.')
|
||||
-@command_opt('target', help='Specify RHEL version to upgrade to for {} detected upgrade flavour'.format(
|
||||
- command_utils.get_upgrade_flavour()))
|
||||
+@command_opt(
|
||||
+ 'target',
|
||||
+ help='Specify RHEL version to upgrade to for {} detected upgrade flavour'.format(
|
||||
+ command_utils.get_upgrade_flavour()
|
||||
+ ),
|
||||
+ aliases=['target-version'],
|
||||
+ dest='target_version',
|
||||
+)
|
||||
@command_opt(
|
||||
'target-os',
|
||||
help='Specify the OS to upgrade to. If this differs from the OS on the'
|
||||
diff --git a/commands/tests/test_upgrade_paths.py b/commands/tests/test_upgrade_paths.py
|
||||
index 59c8ac36..773cdf1c 100644
|
||||
--- a/commands/tests/test_upgrade_paths.py
|
||||
+++ b/commands/tests/test_upgrade_paths.py
|
||||
@@ -83,7 +83,7 @@ def test_get_target_release(mock_open, monkeypatch): # do not remove mock_open
|
||||
monkeypatch.setattr(command_utils, 'get_os_release_version_id', lambda x: '8.6')
|
||||
|
||||
# make sure env var LEAPP_DEVEL_TARGET_RELEASE takes precedence
|
||||
- args = mock.Mock(target='9.0')
|
||||
+ args = mock.Mock(target_version='9.0')
|
||||
monkeypatch.setenv('LEAPP_DEVEL_TARGET_RELEASE', '9.2')
|
||||
print(os.getenv('LEAPP_DEVEL_TARGET_RELEASE'))
|
||||
assert command_utils.get_target_release(args) == ('9.2', 'default')
|
||||
@@ -100,12 +100,12 @@ def test_get_target_release(mock_open, monkeypatch): # do not remove mock_open
|
||||
assert command_utils.get_target_release(args) == ('1.2', 'default')
|
||||
|
||||
# no env var set, --target is set to proper version - use it
|
||||
- args = mock.Mock(target='9.0')
|
||||
+ args = mock.Mock(target_version='9.0')
|
||||
monkeypatch.delenv('LEAPP_DEVEL_TARGET_RELEASE', raising=False)
|
||||
assert command_utils.get_target_release(args) == ('9.0', 'default')
|
||||
|
||||
# --target set with incorrectly formatted version, env var not set, fail
|
||||
- args = mock.Mock(target='9.0a')
|
||||
+ args = mock.Mock(target_version='9.0a')
|
||||
with pytest.raises(CommandError) as err:
|
||||
command_utils.get_target_release(args)
|
||||
assert 'Unexpected format of target version' in err
|
||||
@@ -113,7 +113,7 @@ def test_get_target_release(mock_open, monkeypatch): # do not remove mock_open
|
||||
# env var is set to proper version, --target set to a bad one:
|
||||
# env var has priority, use it and go on with the upgrade
|
||||
monkeypatch.setenv('LEAPP_DEVEL_TARGET_RELEASE', '9.0')
|
||||
- args = mock.Mock(target='9.0.0')
|
||||
+ args = mock.Mock(target_version='9.0.0')
|
||||
assert command_utils.get_target_release(args) == ('9.0', 'default')
|
||||
|
||||
|
||||
diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py
|
||||
index 670a2e7b..31d247df 100644
|
||||
--- a/commands/upgrade/__init__.py
|
||||
+++ b/commands/upgrade/__init__.py
|
||||
@@ -42,8 +42,14 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
choices=['ga', 'e4s', 'eus', 'aus'],
|
||||
value_type=str.lower) # This allows the choices to be case insensitive
|
||||
@command_opt('iso', help='Use provided target RHEL installation image to perform the in-place upgrade.')
|
||||
-@command_opt('target', help='Specify RHEL version to upgrade to for {} detected upgrade flavour'.format(
|
||||
- command_utils.get_upgrade_flavour()))
|
||||
+@command_opt(
|
||||
+ 'target',
|
||||
+ help='Specify RHEL version to upgrade to for {} detected upgrade flavour'.format(
|
||||
+ command_utils.get_upgrade_flavour()
|
||||
+ ),
|
||||
+ aliases=['target-version'],
|
||||
+ dest='target_version',
|
||||
+)
|
||||
@command_opt(
|
||||
'target-os',
|
||||
help='Specify the OS to upgrade to. If this differs from the OS on the'
|
||||
diff --git a/packaging/leapp-repository.spec b/packaging/leapp-repository.spec
|
||||
index a2d245c2..ea7f7043 100644
|
||||
--- a/packaging/leapp-repository.spec
|
||||
+++ b/packaging/leapp-repository.spec
|
||||
@@ -120,7 +120,7 @@ Requires: leapp-repository-dependencies = %{leapp_repo_deps}
|
||||
|
||||
# IMPORTANT: this is capability provided by the leapp framework rpm.
|
||||
# Check that 'version' instead of the real framework rpm version.
|
||||
-Requires: leapp-framework >= 6.1, leapp-framework < 7
|
||||
+Requires: leapp-framework >= 6.2, leapp-framework < 7
|
||||
|
||||
# Since we provide sub-commands for the leapp utility, we expect the leapp
|
||||
# tool to be installed as well.
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,246 +0,0 @@
|
||||
From 3c74cd2e237df1646b73238de51bd0d4e019ec82 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Tue, 7 Oct 2025 17:57:19 +0200
|
||||
Subject: [PATCH 65/69] cs->rhel: Handle potentially unreleased target version
|
||||
|
||||
On CS to RHEL upgrades, particularly on 9->10, there is only one upgrade
|
||||
path defined, CS 9 -> latest RHEL 10 (10.X). However a situation may occur,
|
||||
in which the latest RHEL version has not yet been publicly released, e.g.
|
||||
in pre-release builds.
|
||||
|
||||
This is problematic because the upgrade fails if the content is not yet
|
||||
available. If this happens the user is informed via a hint in the error
|
||||
message to specify the latest available RHEL version (the previous minor
|
||||
version) manually using the --target-version CLI option.
|
||||
|
||||
To make leapp consider the previous minor version as supported without
|
||||
adding it to upgrade_paths.json (which would affect RHEL->RHEL
|
||||
upgrades), it is added to the IPUConfig message after processing the
|
||||
json.
|
||||
|
||||
Also, in the error message, move the existing proxy hints from 'details'
|
||||
to 'hint', otherwise the original exeception message, which is in
|
||||
'details' is overwritten.
|
||||
|
||||
Jira: RHEL-110563
|
||||
---
|
||||
.../libraries/ipuworkflowconfig.py | 50 +++++++++++++++++++
|
||||
.../tests/test_ipuworkflowconfig.py | 47 ++++++++++++++++-
|
||||
.../libraries/userspacegen.py | 46 +++++++++++------
|
||||
3 files changed, 127 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
index 0c05640a..828eee88 100644
|
||||
--- a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
@@ -189,6 +189,53 @@ def construct_models_for_paths_matching_source_major(
|
||||
return multipaths_matching_source
|
||||
|
||||
|
||||
+def _centos_to_rhel_supported_version_workaround(exposed_supported_paths):
|
||||
+ """
|
||||
+ Add target version one minor version lower than the latest version
|
||||
+
|
||||
+ On CS to RHEL upgrades, particularly on 9->10, there is only one upgrade
|
||||
+ path defined, CS 9 -> latest RHEL 10 (10.X). However a situation may occur,
|
||||
+ in which the latest RHEL version has not yet been publicly released, e.g.
|
||||
+ in pre-release builds.
|
||||
+
|
||||
+ This is problematic because the upgrade fails if the content is not yet
|
||||
+ available. If this happens the user is informed (by code elsewhere) to
|
||||
+ specify the latest available RHEL version (the previous minor version)
|
||||
+ manually using the --target-version CLI option.
|
||||
+ However the previous minor version is not a supported target version. This
|
||||
+ function adds it as one by appending it to exposed_supported_paths[0].target_versions.
|
||||
+ The version is not appended if already present or if the defined latest is X.0.
|
||||
+
|
||||
+ :param exposed_supported_paths: The supported upgrade paths. Length is expected to be 1.
|
||||
+ :type exposed_supported_paths: list[IPUSourceToPossibleTargets]
|
||||
+ """
|
||||
+
|
||||
+ if len(exposed_supported_paths) != 1:
|
||||
+ raise StopActorExecutionError(
|
||||
+ "Expected only 1 IPUSourceToPossibleTargets model on CS->RHEL upgrade"
|
||||
+ )
|
||||
+ path = exposed_supported_paths[0]
|
||||
+
|
||||
+ major, minor = max(path.target_versions).split('.')
|
||||
+ if not minor or minor == '0':
|
||||
+ api.current_logger().debug(
|
||||
+ "Skipping centos->rhel supported versions workaround, the latest target minor version is 0."
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ new_minor = int(minor) - 1
|
||||
+ to_add = "{}.{}".format(major, new_minor)
|
||||
+
|
||||
+ if to_add not in path.target_versions:
|
||||
+ msg = "Adding {} as a supported target version for centos->rhel upgrade.".format(to_add)
|
||||
+ path.target_versions.append(to_add)
|
||||
+ else:
|
||||
+ msg = "Skipping adding {} as a target version for centos->rhel upgrade, already present.".format(
|
||||
+ to_add
|
||||
+ )
|
||||
+ api.current_logger().debug(msg)
|
||||
+
|
||||
+
|
||||
def produce_ipu_config(actor):
|
||||
flavour = os.environ.get('LEAPP_UPGRADE_PATH_FLAVOUR')
|
||||
target_version = os.environ.get('LEAPP_UPGRADE_PATH_TARGET_RELEASE')
|
||||
@@ -219,6 +266,9 @@ def produce_ipu_config(actor):
|
||||
raw_upgrade_paths, source_major_version
|
||||
)
|
||||
|
||||
+ if exposed_supported_paths and os_release.release_id == 'centos' and target_distro == 'rhel':
|
||||
+ _centos_to_rhel_supported_version_workaround(exposed_supported_paths)
|
||||
+
|
||||
actor.produce(IPUConfig(
|
||||
leapp_env_vars=get_env_vars(),
|
||||
os_release=os_release,
|
||||
diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
index c0deaf0e..583cdfc5 100644
|
||||
--- a/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/tests/test_ipuworkflowconfig.py
|
||||
@@ -1,10 +1,12 @@
|
||||
import os
|
||||
+from copy import deepcopy
|
||||
|
||||
import pytest
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.actor import ipuworkflowconfig
|
||||
-from leapp.libraries.stdlib import CalledProcessError
|
||||
+from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
from leapp.models import IPUSourceToPossibleTargets, OSRelease
|
||||
|
||||
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
@@ -260,3 +262,46 @@ def test_load_raw_upgrade_paths_for_distro_and_flavour(monkeypatch, distro, flav
|
||||
def test_virtual_version_construction(construction_params, expected_versions):
|
||||
result = ipuworkflowconfig.get_virtual_version(TEST_UPGRADE_PATHS, *construction_params)
|
||||
assert result == expected_versions
|
||||
+
|
||||
+
|
||||
+def _make_path(source_ver, target_vers):
|
||||
+ return IPUSourceToPossibleTargets(source_version=source_ver, target_versions=target_vers)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ "paths,to_add,logmsg",
|
||||
+ [
|
||||
+ (
|
||||
+ [_make_path("9.8", ["10.2"])],
|
||||
+ ["10.1"],
|
||||
+ "Adding 10.1 as a supported target version for centos->rhel upgrade."
|
||||
+ ),
|
||||
+ (
|
||||
+ [_make_path("9.10", ["10.10"])],
|
||||
+ ["10.9"],
|
||||
+ "Adding 10.9 as a supported target version for centos->rhel upgrade."
|
||||
+ ),
|
||||
+ # already present
|
||||
+ (
|
||||
+ [_make_path("8.10", ["9.6", "9.7"])],
|
||||
+ [],
|
||||
+ "Skipping adding 9.6 as a target version for centos->rhel upgrade, already present."
|
||||
+ ),
|
||||
+ # lowest minor
|
||||
+ (
|
||||
+ [_make_path("9.6", ["10.0"])],
|
||||
+ [],
|
||||
+ "Skipping centos->rhel supported versions workaround, the latest target minor version is 0."
|
||||
+ ),
|
||||
+ ],
|
||||
+)
|
||||
+def test_centos_to_rhel_supported_version_workaround(monkeypatch, paths, to_add, logmsg):
|
||||
+ logger = logger_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger)
|
||||
+
|
||||
+ original = deepcopy(paths[0])
|
||||
+ ipuworkflowconfig._centos_to_rhel_supported_version_workaround(paths)
|
||||
+
|
||||
+ assert paths[0].source_version == original.source_version
|
||||
+ assert paths[0].target_versions == original.target_versions + to_add
|
||||
+ assert logmsg in logger.dbgmsg[0]
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 9df83ef8..c825c731 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -7,8 +7,8 @@ from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecution, StopActorExecutionError
|
||||
from leapp.libraries.actor import constants
|
||||
from leapp.libraries.common import distro, dnfplugin, mounting, overlaygen, repofileutils, rhsm, utils
|
||||
-from leapp.libraries.common.config import get_env, get_product_type, get_target_distro_id
|
||||
-from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.libraries.common.config import get_env, get_product_type, get_source_distro_id, get_target_distro_id
|
||||
+from leapp.libraries.common.config.version import get_target_major_version, get_target_version
|
||||
from leapp.libraries.common.gpg import get_path_to_gpg_certs, is_nogpgcheck_set
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, config, run
|
||||
from leapp.models import RequiredTargetUserspacePackages # deprecated
|
||||
@@ -250,7 +250,9 @@ def prepare_target_userspace(context, userspace_dir, enabled_repos, packages):
|
||||
try:
|
||||
context.call(cmd, callback_raw=utils.logging_handler)
|
||||
except CalledProcessError as exc:
|
||||
- message = 'Unable to install RHEL {} userspace packages.'.format(target_major_version)
|
||||
+ message = 'Unable to install target \'{}\' {} userspace packages.'.format(
|
||||
+ get_target_distro_id(), target_major_version
|
||||
+ )
|
||||
details = {'details': str(exc), 'stderr': exc.stderr}
|
||||
|
||||
if 'more space needed on the' in exc.stderr:
|
||||
@@ -263,26 +265,40 @@ def prepare_target_userspace(context, userspace_dir, enabled_repos, packages):
|
||||
# failed since leapp does not support updates behind proxy yet.
|
||||
for manager_info in api.consume(PkgManagerInfo):
|
||||
if manager_info.configured_proxies:
|
||||
- details['details'] = (
|
||||
- "DNF failed to install userspace packages, likely due to the proxy "
|
||||
- "configuration detected in the YUM/DNF configuration file. "
|
||||
- "Make sure the proxy is properly configured in /etc/dnf/dnf.conf. "
|
||||
- "It's also possible the proxy settings in the DNF configuration file are "
|
||||
- "incompatible with the target system. A compatible configuration can be "
|
||||
- "placed in /etc/leapp/files/dnf.conf which, if present, will be used during "
|
||||
- "the upgrade instead of /etc/dnf/dnf.conf. "
|
||||
- "In such case the configuration will also be applied to the target system."
|
||||
+ details['hint'] = (
|
||||
+ 'DNF failed to install userspace packages, likely due to the proxy '
|
||||
+ 'configuration detected in the YUM/DNF configuration file. '
|
||||
+ 'Make sure the proxy is properly configured in /etc/dnf/dnf.conf. '
|
||||
+ 'It\'s also possible the proxy settings in the DNF configuration file are '
|
||||
+ 'incompatible with the target system. A compatible configuration can be '
|
||||
+ 'placed in /etc/leapp/files/dnf.conf which, if present, will be used during '
|
||||
+ 'the upgrade instead of /etc/dnf/dnf.conf. '
|
||||
+ 'In such case the configuration will also be applied to the target system.'
|
||||
)
|
||||
|
||||
# Similarly if a proxy was set specifically for one of the repositories.
|
||||
for repo_facts in api.consume(RepositoriesFacts):
|
||||
for repo_file in repo_facts.repositories:
|
||||
if any(repo_data.proxy and repo_data.enabled for repo_data in repo_file.data):
|
||||
- details['details'] = (
|
||||
- "DNF failed to install userspace packages, likely due to the proxy "
|
||||
- "configuration detected in a repository configuration file."
|
||||
+ details['hint'] = (
|
||||
+ 'DNF failed to install userspace packages, likely due to the proxy '
|
||||
+ 'configuration detected in a repository configuration file.'
|
||||
)
|
||||
|
||||
+ if get_source_distro_id() == 'centos' and get_target_distro_id() == 'rhel':
|
||||
+ check_rhel_release_hint = (
|
||||
+ 'When upgrading and converting from Centos Stream to Red Hat Enterprise Linux'
|
||||
+ ' (RHEL), the automatically determined latest target version of RHEL \'{}\' might'
|
||||
+ ' not yet have been released. If so, specify the latest released RHEL version'
|
||||
+ ' manually using the --target-version commandline option.'
|
||||
+ ).format(get_target_version())
|
||||
+
|
||||
+ if details.get('hint'):
|
||||
+ # keep the proxy hint, we don't know which one is the problem
|
||||
+ details['hint'] = f"{details['hint']}\n\n{check_rhel_release_hint}"
|
||||
+ else:
|
||||
+ details['hint'] = check_rhel_release_hint
|
||||
+
|
||||
raise StopActorExecutionError(message=message, details=details)
|
||||
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
From 7bd5eaf205aed7648ea066b32ec822db57536e8b Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 13 Nov 2025 13:51:55 +0100
|
||||
Subject: [PATCH 66/69] docs: Document LEAPP_DEVEL_TARGET_OS envar
|
||||
|
||||
---
|
||||
docs/source/configuring-ipu/envars.md | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/docs/source/configuring-ipu/envars.md b/docs/source/configuring-ipu/envars.md
|
||||
index 09634df2..72d00634 100644
|
||||
--- a/docs/source/configuring-ipu/envars.md
|
||||
+++ b/docs/source/configuring-ipu/envars.md
|
||||
@@ -88,3 +88,6 @@ Change the default target RHEL version. Format: `MAJOR.MINOR`.
|
||||
|
||||
#### LEAPP_DEVEL_USE_PERSISTENT_PACKAGE_CACHE
|
||||
Caches downloaded packages when set to `1`. This will reduce the time needed by leapp when executed multiple times, because it will not have to download already downloaded packages. However, this can lead to a random issues in case the data is not up-to-date or when setting or repositories change. The environment variable is meant to be used only for the part of the upgrade before the reboot and has no effect or use otherwise.
|
||||
+
|
||||
+#### LEAPP_DEVEL_TARGET_OS
|
||||
+Change the target OS. This is similar to the --target-os CLI option except there is no restriction on what values can be passed in. This can be used when developing conversions to a yet unsupported target OS.
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,119 +0,0 @@
|
||||
From 2b4d631e975235e2b517fd7a942136e6cc33ed12 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 10 Nov 2025 08:42:14 +0100
|
||||
Subject: [PATCH 67/69] fix unsupported source version crash
|
||||
|
||||
This patch fixes a crash when executing upgrade on a system with version
|
||||
that is not defined in the supported upgrade paths map and when the
|
||||
fallback mechanism for this particular case fails as well. The upgrade
|
||||
process is now terminated with an error instead of a trace back.
|
||||
|
||||
Jira: RHEL-120252
|
||||
---
|
||||
commands/upgrade/util.py | 18 ++++++----
|
||||
.../libraries/ipuworkflowconfig.py | 34 +++++++++++++------
|
||||
2 files changed, 34 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/commands/upgrade/util.py b/commands/upgrade/util.py
|
||||
index da319448..1dbc0abd 100644
|
||||
--- a/commands/upgrade/util.py
|
||||
+++ b/commands/upgrade/util.py
|
||||
@@ -263,14 +263,18 @@ def prepare_configuration(args):
|
||||
|
||||
# Check upgrade path and fail early if it's invalid
|
||||
target_version, flavor = command_utils.get_target_release(args)
|
||||
- os.environ['LEAPP_UPGRADE_PATH_TARGET_RELEASE'] = target_version
|
||||
- os.environ['LEAPP_UPGRADE_PATH_FLAVOUR'] = flavor
|
||||
-
|
||||
current_version = command_utils.get_os_release_version_id('/etc/os-release')
|
||||
- os.environ['LEAPP_IPU_IN_PROGRESS'] = '{source}to{target}'.format(
|
||||
- source=command_utils.get_major_version_from_a_valid_version(current_version),
|
||||
- target=command_utils.get_major_version_from_a_valid_version(target_version)
|
||||
- )
|
||||
+ if current_version and target_version:
|
||||
+ os.environ['LEAPP_UPGRADE_PATH_TARGET_RELEASE'] = target_version
|
||||
+ os.environ['LEAPP_IPU_IN_PROGRESS'] = '{source}to{target}'.format(
|
||||
+ source=command_utils.get_major_version_from_a_valid_version(current_version),
|
||||
+ target=command_utils.get_major_version_from_a_valid_version(target_version)
|
||||
+ )
|
||||
+ else:
|
||||
+ # Setting these variables to prevent them being set outside of the leapp environment
|
||||
+ os.environ['LEAPP_UPGRADE_PATH_TARGET_RELEASE'] = ''
|
||||
+ os.environ['LEAPP_IPU_IN_PROGRESS'] = ''
|
||||
+ os.environ['LEAPP_UPGRADE_PATH_FLAVOUR'] = flavor
|
||||
|
||||
configuration = {
|
||||
'debug': os.getenv('LEAPP_DEBUG', '0'),
|
||||
diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
index 828eee88..999a001e 100644
|
||||
--- a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py
|
||||
@@ -239,26 +239,38 @@ def _centos_to_rhel_supported_version_workaround(exposed_supported_paths):
|
||||
def produce_ipu_config(actor):
|
||||
flavour = os.environ.get('LEAPP_UPGRADE_PATH_FLAVOUR')
|
||||
target_version = os.environ.get('LEAPP_UPGRADE_PATH_TARGET_RELEASE')
|
||||
+ target_distro = os.environ.get('LEAPP_TARGET_OS')
|
||||
os_release = get_os_release('/etc/os-release')
|
||||
source_version = os_release.version_id
|
||||
- target_distro = os.environ.get('LEAPP_TARGET_OS')
|
||||
+ source_distro = os_release.release_id
|
||||
|
||||
+ all_upgrade_path_defs = load_upgrade_paths_definitions('upgrade_paths.json')
|
||||
+ raw_upgrade_paths = extract_upgrade_paths_for_distro_and_flavour(all_upgrade_path_defs, source_distro, flavour)
|
||||
+
|
||||
+ if not target_version:
|
||||
+ details = {}
|
||||
+ if source_distro not in all_upgrade_path_defs:
|
||||
+ details['details'] = 'This is due to an unsupported system distribution.'
|
||||
+ elif source_version not in raw_upgrade_paths:
|
||||
+ details['details'] = 'This is due to an unsupported source version of the system.'
|
||||
+ details['hint'] = (
|
||||
+ 'The in-place upgrade is possible only for the supported upgrade paths '
|
||||
+ 'listed here: https://access.redhat.com/articles/4263361'
|
||||
+ )
|
||||
+ raise StopActorExecutionError(message='Could not determine the target version for the in-place upgrade.',
|
||||
+ details=details)
|
||||
check_target_major_version(source_version, target_version)
|
||||
|
||||
- all_upgrade_path_defs = load_upgrade_paths_definitions('upgrade_paths.json')
|
||||
- raw_upgrade_paths = extract_upgrade_paths_for_distro_and_flavour(all_upgrade_path_defs,
|
||||
- os_release.release_id,
|
||||
- flavour)
|
||||
- if os_release.release_id == target_distro:
|
||||
+ if source_distro == target_distro:
|
||||
raw_upgrade_paths = extract_upgrade_paths_for_distro_and_flavour(
|
||||
- all_upgrade_path_defs, os_release.release_id, flavour
|
||||
+ all_upgrade_path_defs, source_distro, flavour
|
||||
)
|
||||
else:
|
||||
raw_upgrade_paths = make_cross_distro_paths(
|
||||
- all_upgrade_path_defs, os_release.release_id, target_distro, flavour
|
||||
+ all_upgrade_path_defs, source_distro, target_distro, flavour
|
||||
)
|
||||
|
||||
- virtual_source_version = get_virtual_version(all_upgrade_path_defs, os_release.release_id, source_version)
|
||||
+ virtual_source_version = get_virtual_version(all_upgrade_path_defs, source_distro, source_version)
|
||||
virtual_target_version = get_virtual_version(all_upgrade_path_defs, target_distro, target_version)
|
||||
|
||||
source_major_version = source_version.split('.')[0]
|
||||
@@ -266,7 +278,7 @@ def produce_ipu_config(actor):
|
||||
raw_upgrade_paths, source_major_version
|
||||
)
|
||||
|
||||
- if exposed_supported_paths and os_release.release_id == 'centos' and target_distro == 'rhel':
|
||||
+ if exposed_supported_paths and source_distro == 'centos' and target_distro == 'rhel':
|
||||
_centos_to_rhel_supported_version_workaround(exposed_supported_paths)
|
||||
|
||||
actor.produce(IPUConfig(
|
||||
@@ -283,7 +295,7 @@ def produce_ipu_config(actor):
|
||||
flavour=flavour,
|
||||
supported_upgrade_paths=exposed_supported_paths,
|
||||
distro=Distro(
|
||||
- source=os_release.release_id,
|
||||
+ source=source_distro,
|
||||
target=target_distro,
|
||||
),
|
||||
))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
From ec92108de4331f01b800e9d88bc1b52a90ed9358 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 10 Nov 2025 09:02:26 +0100
|
||||
Subject: [PATCH 68/69] define fallback entries in the upgrade paths map for
|
||||
AlmaLinux
|
||||
|
||||
The upgrade paths map contains fallback entries which make sure a target
|
||||
upgrade version is found regardless of the source minor version. This patch
|
||||
defines fallback entries for AlmaLinux.
|
||||
|
||||
Jira: RHEL-120252
|
||||
---
|
||||
repos/system_upgrade/common/files/upgrade_paths.json | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/files/upgrade_paths.json b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
index 61bb73c0..39fbe6c1 100644
|
||||
--- a/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
+++ b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
@@ -33,8 +33,10 @@
|
||||
},
|
||||
"almalinux": {
|
||||
"default": {
|
||||
- "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7","9.8"],
|
||||
- "9.7": ["10.0", "10.1"]
|
||||
+ "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7", "9.8"],
|
||||
+ "9.7": ["10.0", "10.1"],
|
||||
+ "8": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7", "9.8"],
|
||||
+ "9": ["10.0", "10.1"]
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -1,213 +0,0 @@
|
||||
From 249cd3b203d05937a4d4a02b484444291f4aed85 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 13 Nov 2025 14:31:45 +0100
|
||||
Subject: [PATCH 69/69] Add basic CS8 repomapping
|
||||
|
||||
Only the most common EL repos are mapped, still a bunch of unmapped,
|
||||
most notably resilientstorage and extras, leaving that up for a
|
||||
followup.
|
||||
|
||||
Jira: RHEL-125081
|
||||
---
|
||||
etc/leapp/files/repomap.json | 146 ++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 145 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/etc/leapp/files/repomap.json b/etc/leapp/files/repomap.json
|
||||
index 533e56fb..c4ae9038 100644
|
||||
--- a/etc/leapp/files/repomap.json
|
||||
+++ b/etc/leapp/files/repomap.json
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
- "datetime": "202511121444Z",
|
||||
+ "datetime": "202511131423Z",
|
||||
"version_format": "1.3.0",
|
||||
"provided_data_streams": [
|
||||
"4.1"
|
||||
@@ -3081,6 +3081,38 @@
|
||||
{
|
||||
"pesid": "rhel8-BaseOS",
|
||||
"entries": [
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "baseos",
|
||||
+ "arch": "aarch64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "baseos",
|
||||
+ "arch": "ppc64le",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "baseos",
|
||||
+ "arch": "s390x",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "baseos",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
{
|
||||
"major_version": "8",
|
||||
"repoid": "rhel-8-baseos-beta-rhui-rpms",
|
||||
@@ -3348,6 +3380,38 @@
|
||||
{
|
||||
"pesid": "rhel8-AppStream",
|
||||
"entries": [
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "appstream",
|
||||
+ "arch": "aarch64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "appstream",
|
||||
+ "arch": "ppc64le",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "appstream",
|
||||
+ "arch": "s390x",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "appstream",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
{
|
||||
"major_version": "8",
|
||||
"repoid": "rhel-8-appstream-beta-rhui-rpms",
|
||||
@@ -3747,6 +3811,38 @@
|
||||
"repo_type": "rpm",
|
||||
"distro": "rhel"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "powertools",
|
||||
+ "arch": "aarch64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "powertools",
|
||||
+ "arch": "ppc64le",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "powertools",
|
||||
+ "arch": "s390x",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "powertools",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
{
|
||||
"major_version": "8",
|
||||
"repoid": "rhui-codeready-builder-for-rhel-8-aarch64-rhui-rpms",
|
||||
@@ -3958,12 +4054,28 @@
|
||||
"channel": "ga",
|
||||
"repo_type": "rpm",
|
||||
"distro": "rhel"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "rt",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pesid": "rhel8-NFV",
|
||||
"entries": [
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "nfv",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
{
|
||||
"major_version": "8",
|
||||
"repoid": "rhel-8-for-x86_64-nfv-beta-rpms",
|
||||
@@ -4236,6 +4348,38 @@
|
||||
{
|
||||
"pesid": "rhel8-HighAvailability",
|
||||
"entries": [
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "ha",
|
||||
+ "arch": "aarch64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "ha",
|
||||
+ "arch": "ppc64le",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "ha",
|
||||
+ "arch": "s390x",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
+ {
|
||||
+ "major_version": "8",
|
||||
+ "repoid": "ha",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "ga",
|
||||
+ "repo_type": "rpm",
|
||||
+ "distro": "centos"
|
||||
+ },
|
||||
{
|
||||
"major_version": "8",
|
||||
"repoid": "rhel-8-for-aarch64-highavailability-beta-rpms",
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -7,19 +7,9 @@
|
||||
%if 0%{?rhel} == 7
|
||||
%define leapp_python_sitelib %{python2_sitelib}
|
||||
%define lpr_name leapp-upgrade-el7toel8
|
||||
%define repo_shortname el7toel8
|
||||
%define next_major_ver 8
|
||||
%else
|
||||
%define leapp_python_sitelib %{python3_sitelib}
|
||||
%if 0%{?rhel} == 8
|
||||
%define lpr_name leapp-upgrade-el8toel9
|
||||
%define repo_shortname el8toel9
|
||||
%define next_major_ver 9
|
||||
%else
|
||||
%define lpr_name leapp-upgrade-el9toel10
|
||||
%define repo_shortname el9toel10
|
||||
%define next_major_ver 10
|
||||
%endif
|
||||
|
||||
# This drops autogenerated deps on
|
||||
# - /usr/libexec/platform-python (rhel-8 buildroot)
|
||||
@ -51,89 +41,23 @@ py2_byte_compile "%1" "%2"}
|
||||
# RHEL 8+ packages to be consistent with other leapp projects in future.
|
||||
|
||||
Name: leapp-repository
|
||||
Version: 0.23.0
|
||||
Version: 0.20.0
|
||||
Release: 2%{?dist}
|
||||
Summary: Repositories for leapp
|
||||
|
||||
License: ASL 2.0
|
||||
URL: https://oamg.github.io/leapp/
|
||||
Source0: https://github.com/oamg/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
Source1: deps-pkgs-13.tar.gz
|
||||
Source1: deps-pkgs-10.tar.gz
|
||||
|
||||
# NOTE: Our packages must be noarch. Do no drop this in any way.
|
||||
BuildArch: noarch
|
||||
|
||||
### PATCHES HERE
|
||||
# Patch0001: filename.patch
|
||||
Patch0001: 0001-Add-upgrade-inhibitor-for-custom-DNF-pluginpath-conf.patch
|
||||
Patch0002: 0002-Upgrade-dracut-module-Update-usr-mounting-solution.patch
|
||||
Patch0003: 0003-feat-lvm_autoactivation-add-lvm-autoactivation.patch
|
||||
Patch0004: 0004-feat-mount_unit_gen-generate-mount-units-for-the-upg.patch
|
||||
Patch0005: 0005-Prevent-sssdupdate-actor-from-rising-errors.patch
|
||||
Patch0006: 0006-Update-our-test-container-to-Fedora-42.patch
|
||||
Patch0007: 0007-networkmanagerconnectionscanner-Skip-test-on-Python-.patch
|
||||
Patch0008: 0008-Remove-unused-rh-el7-Containerfiles.patch
|
||||
Patch0009: 0009-Rename-Containerfiles-to-consistent-names.patch
|
||||
Patch0010: 0010-Replace-ubi-8-containers-with-centos-8.patch
|
||||
Patch0011: 0011-chore-deps-update-actions-checkout-action-to-v5.patch
|
||||
Patch0012: 0012-LiveMode-Add-etc-crypttab-file-to-the-target-userspa.patch
|
||||
Patch0013: 0013-livemode-Include-etc-crypttab-in-upgrade-initramfs.patch
|
||||
Patch0014: 0014-overlaygen-Fix-not-enough-arguments-for-format-strin.patch
|
||||
Patch0015: 0015-Generalize-TargetRepositories.patch
|
||||
Patch0016: 0016-checktargetrepos-Skip-if-not-RHEL.patch
|
||||
Patch0017: 0017-userspacegen-Add-repo-gathering-for-non-RHEL-distros.patch
|
||||
Patch0018: 0018-lib-distro-Add-tests-for-existing-get_distribution_d.patch
|
||||
Patch0019: 0019-Disable-RHSM-tests.patch
|
||||
Patch0020: 0020-Update-packit-config.patch
|
||||
Patch0021: 0021-Update-upgrade-paths-8.10-9.8-10.2-with-certificates.patch
|
||||
Patch0022: 0022-Add-kpatch-actor-to-el9toel10.patch
|
||||
Patch0023: 0023-move-kpatch-actor-to-common-repo.patch
|
||||
Patch0024: 0024-Makefile-Do-not-copy-unnecessary-files-to-test-conta.patch
|
||||
Patch0025: 0025-Makefile-Properly-copy-commands-dir-to-test-containe.patch
|
||||
Patch0026: 0026-livemode-update-obsoleted-log-msg-about-config.patch
|
||||
Patch0027: 0027-chore-RHINENG-19596-Rebrand-Insights-to-Lightspeed.patch
|
||||
Patch0028: 0028-ceph-luks-Fix-ceph-cephvolumescan-for-cephadm.patch
|
||||
Patch0029: 0029-Makefile-Do-copy-commands-dir-in-containerized-tests.patch
|
||||
Patch0030: 0030-skip-pre-generation-of-systemd-fstab-mount-units-dur.patch
|
||||
Patch0031: 0031-pylint-enable-consider-using-set-comprehension.patch
|
||||
Patch0032: 0032-pylint-enable-consider-using-with.patch
|
||||
Patch0033: 0033-pylint-duplicate-string-formatting-argument.patch
|
||||
Patch0034: 0034-pylint-enable-use-dict-literal.patch
|
||||
Patch0035: 0035-pylint-enable-redundant-u-string-prefix.patch
|
||||
Patch0036: 0036-pylint-enable-logging-not-lazy.patch
|
||||
Patch0037: 0037-pylint-enable-use-yield-from.patch
|
||||
Patch0038: 0038-pylint-enable-useless-object-inheritance.patch
|
||||
Patch0039: 0039-pylint-enable-invalid-envvar-default.patch
|
||||
Patch0040: 0040-pylint-enable-bad-option-value.patch
|
||||
Patch0041: 0041-pylint-enable-super-with-arguments.patch
|
||||
Patch0042: 0042-pylint-enable-use-a-generator.patch
|
||||
Patch0043: 0043-Set-CurrentActorMocked-src-dst-version-to-8-9-values.patch
|
||||
Patch0044: 0044-scancpu-Remove-non-JSON-txt-lscpu-output-support.patch
|
||||
Patch0045: 0045-modify_userspace_for_livemode-Remove-RHEL7-crypto-po.patch
|
||||
Patch0046: 0046-modify_userspace_for_livemode-Remove-unused-code-in-.patch
|
||||
Patch0047: 0047-repositoriesblacklist-Remove-the-rhel7-optional-unsu.patch
|
||||
Patch0048: 0048-mount_unit_gen-bind-mount-sysroot-boot-to-boot.patch
|
||||
Patch0049: 0049-fix-parsing-of-dnf-config-dump.patch
|
||||
Patch0050: 0050-Add-detection-for-third-party-target-Python-modules.patch
|
||||
Patch0051: 0051-Update-data-files-to-a-new-version-4.1.patch
|
||||
Patch0052: 0052-Makefile-Make-sanity-check-respect-REPOSITORIES.patch
|
||||
Patch0053: 0053-Makefile-Partially-fix-ACTOR-tests-and-enable-them-i.patch
|
||||
Patch0054: 0054-make-error-uniformly-when-ACTOR-without-REPOSITORIES.patch
|
||||
Patch0055: 0055-Makefile-Skip-tests-with-ACTOR-when-it-s-not-present.patch
|
||||
Patch0056: 0056-Add-LEAPP_DEVEL_TARGET_OS-devel-environment-var.patch
|
||||
Patch0057: 0057-commands-Get-target-version-based-on-target-distro.patch
|
||||
Patch0058: 0058-ipuconfig-Add-source-and-target-distros-to-config.patch
|
||||
Patch0059: 0059-ipuconfig-Allow-for-one-of-the-virtual-version-to-be.patch
|
||||
Patch0060: 0060-ipuconfig-Map-source-to-target-distro-paths-when-con.patch
|
||||
Patch0061: 0061-Split-get_distro_id-into-variants-for-source-and-tar.patch
|
||||
Patch0062: 0062-lib-version-Also-peform-version-correction-when-targ.patch
|
||||
Patch0063: 0063-Add-target-os-CLI-option.patch
|
||||
Patch0064: 0064-Add-target-version-as-an-alias-for-the-target-option.patch
|
||||
Patch0065: 0065-cs-rhel-Handle-potentially-unreleased-target-version.patch
|
||||
Patch0066: 0066-docs-Document-LEAPP_DEVEL_TARGET_OS-envar.patch
|
||||
Patch0067: 0067-fix-unsupported-source-version-crash.patch
|
||||
Patch0068: 0068-define-fallback-entries-in-the-upgrade-paths-map-for.patch
|
||||
Patch0069: 0069-Add-basic-CS8-repomapping.patch
|
||||
|
||||
Patch0001: 0001-rhui-do-not-bootstrap-target-client-on-aws.patch
|
||||
|
||||
|
||||
%description
|
||||
%{summary}
|
||||
@ -162,24 +86,14 @@ Obsoletes: leapp-repository-sos-plugin <= 0.10.0
|
||||
Conflicts: leapp-upgrade-el8toel9
|
||||
|
||||
%else
|
||||
######### RHEL 8+ (and newer) ############
|
||||
######### RHEL 8 ############
|
||||
BuildRequires: python3-devel
|
||||
Requires: python3-leapp
|
||||
|
||||
# NOTE(pstodulk): else if / elif has been implemented quite late. as we still
|
||||
# want to build on RHEL 7 too, go in the old way. Ref:
|
||||
# https://github.com/rpm-software-management/rpm/issues/311
|
||||
%if 0%{?rhel} == 8
|
||||
######### RHEL 8 ############
|
||||
|
||||
# Same as the conflict above - we want to be sure our packages are untouched
|
||||
# during the whole IPU process
|
||||
Conflicts: leapp-upgrade-el7toel8
|
||||
Conflicts: leapp-upgrade-el9toel10
|
||||
%else
|
||||
######### RHEL 9 ############
|
||||
Conflicts: leapp-upgrade-el8toel9
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
# IMPORTANT: every time the requirements are changed, increment number by one
|
||||
@ -188,7 +102,7 @@ Requires: leapp-repository-dependencies = %{leapp_repo_deps}
|
||||
|
||||
# IMPORTANT: this is capability provided by the leapp framework rpm.
|
||||
# Check that 'version' instead of the real framework rpm version.
|
||||
Requires: leapp-framework >= 6.2
|
||||
Requires: leapp-framework >= 5.0
|
||||
|
||||
# Since we provide sub-commands for the leapp utility, we expect the leapp
|
||||
# tool to be installed as well.
|
||||
@ -198,10 +112,6 @@ Requires: leapp
|
||||
# uncompressing redhat-release package from the ISO.
|
||||
Requires: cpio
|
||||
|
||||
# Subpackage for managing fapolicyd rules for %{lpr_name} installed only if
|
||||
# fapolicyd is present on the system
|
||||
Requires: (%{lpr_name}-fapolicyd = %{version}-%{release} if fapolicyd)
|
||||
|
||||
# The leapp-repository rpm is renamed to %%{lpr_name}
|
||||
Obsoletes: leapp-repository < 0.14.0-5
|
||||
Provides: leapp-repository = %{version}-%{release}
|
||||
@ -283,12 +193,6 @@ Requires: dracut
|
||||
Requires: NetworkManager-libnm
|
||||
Requires: python3-gobject-base
|
||||
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} == 9
|
||||
############# RHEL 9 dependencies (when the source system is RHEL 9) ##########
|
||||
# Required to convert pam_userdb database from BerkeleyDB to GDBM
|
||||
Requires: libdb-utils
|
||||
%endif
|
||||
##################################################
|
||||
# end requirement
|
||||
@ -299,93 +203,21 @@ Requires: libdb-utils
|
||||
%{summary}
|
||||
|
||||
|
||||
%package -n %{lpr_name}-fapolicyd
|
||||
Summary: Manage fapolicyd rules for %{lpr_name} during the upgrade
|
||||
|
||||
Requires: fapolicyd
|
||||
|
||||
%description -n %{lpr_name}-fapolicyd
|
||||
%{summary}
|
||||
|
||||
|
||||
%prep
|
||||
%setup -n %{name}-%{version}
|
||||
%setup -q -n %{name}-%{version} -D -T -a 1
|
||||
|
||||
# APPLY PATCHES HERE
|
||||
# %%patch -P 0001 -p1
|
||||
%patch -P 0001 -p1
|
||||
%patch -P 0002 -p1
|
||||
%patch -P 0003 -p1
|
||||
%patch -P 0004 -p1
|
||||
%patch -P 0005 -p1
|
||||
%patch -P 0006 -p1
|
||||
%patch -P 0007 -p1
|
||||
%patch -P 0008 -p1
|
||||
%patch -P 0009 -p1
|
||||
%patch -P 0010 -p1
|
||||
%patch -P 0011 -p1
|
||||
%patch -P 0012 -p1
|
||||
%patch -P 0013 -p1
|
||||
%patch -P 0014 -p1
|
||||
%patch -P 0015 -p1
|
||||
%patch -P 0016 -p1
|
||||
%patch -P 0017 -p1
|
||||
%patch -P 0018 -p1
|
||||
%patch -P 0019 -p1
|
||||
%patch -P 0020 -p1
|
||||
%patch -P 0021 -p1
|
||||
%patch -P 0022 -p1
|
||||
%patch -P 0023 -p1
|
||||
%patch -P 0024 -p1
|
||||
%patch -P 0025 -p1
|
||||
%patch -P 0026 -p1
|
||||
%patch -P 0027 -p1
|
||||
%patch -P 0028 -p1
|
||||
%patch -P 0029 -p1
|
||||
%patch -P 0030 -p1
|
||||
%patch -P 0031 -p1
|
||||
%patch -P 0032 -p1
|
||||
%patch -P 0033 -p1
|
||||
%patch -P 0034 -p1
|
||||
%patch -P 0035 -p1
|
||||
%patch -P 0036 -p1
|
||||
%patch -P 0037 -p1
|
||||
%patch -P 0038 -p1
|
||||
%patch -P 0039 -p1
|
||||
%patch -P 0040 -p1
|
||||
%patch -P 0041 -p1
|
||||
%patch -P 0042 -p1
|
||||
%patch -P 0043 -p1
|
||||
%patch -P 0044 -p1
|
||||
%patch -P 0045 -p1
|
||||
%patch -P 0046 -p1
|
||||
%patch -P 0047 -p1
|
||||
%patch -P 0048 -p1
|
||||
%patch -P 0049 -p1
|
||||
%patch -P 0050 -p1
|
||||
%patch -P 0051 -p1
|
||||
%patch -P 0052 -p1
|
||||
%patch -P 0053 -p1
|
||||
%patch -P 0054 -p1
|
||||
%patch -P 0055 -p1
|
||||
%patch -P 0056 -p1
|
||||
%patch -P 0057 -p1
|
||||
%patch -P 0058 -p1
|
||||
%patch -P 0059 -p1
|
||||
%patch -P 0060 -p1
|
||||
%patch -P 0061 -p1
|
||||
%patch -P 0062 -p1
|
||||
%patch -P 0063 -p1
|
||||
%patch -P 0064 -p1
|
||||
%patch -P 0065 -p1
|
||||
%patch -P 0066 -p1
|
||||
%patch -P 0067 -p1
|
||||
%patch -P 0068 -p1
|
||||
%patch -P 0069 -p1
|
||||
# %%patch0001 -p1
|
||||
%patch0001 -p1
|
||||
|
||||
|
||||
%build
|
||||
cp -a leapp*deps*el%{next_major_ver}.noarch.rpm repos/system_upgrade/%{repo_shortname}/files/bundled-rpms/
|
||||
%if 0%{?rhel} == 7
|
||||
cp -a leapp*deps*el8.noarch.rpm repos/system_upgrade/el7toel8/files/bundled-rpms/
|
||||
%else
|
||||
cp -a leapp*deps*el9.noarch.rpm repos/system_upgrade/el8toel9/files/bundled-rpms/
|
||||
%endif
|
||||
|
||||
|
||||
%install
|
||||
@ -393,19 +225,11 @@ install -m 0755 -d %{buildroot}%{custom_repositorydir}
|
||||
install -m 0755 -d %{buildroot}%{repositorydir}
|
||||
cp -r repos/* %{buildroot}%{repositorydir}/
|
||||
install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/repos.d/
|
||||
# NOTE(pstodulk): drop transaction dir and its content if replaced by config files before RHEL 10
|
||||
install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/transaction/
|
||||
install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/files/
|
||||
install -m 0644 etc/leapp/transaction/* %{buildroot}%{_sysconfdir}/leapp/transaction
|
||||
install -m 0644 etc/leapp/files/* %{buildroot}%{_sysconfdir}/leapp/files
|
||||
|
||||
# install rules necessary for fapolicy
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/fapolicyd/rules.d/
|
||||
install -m 0644 etc/fapolicyd/rules.d/31-leapp-repository.rules %{buildroot}%{_sysconfdir}/fapolicyd/rules.d
|
||||
|
||||
# uncomment to install existing configs if any exists
|
||||
#install -m 0644 etc/leapp/actor_conf.d/* %%{buildroot}%%{_sysconfdir}/leapp/actor_conf.d
|
||||
|
||||
# install CLI commands for the leapp utility on the expected path
|
||||
install -m 0755 -d %{buildroot}%{leapp_python_sitelib}/leapp/cli/
|
||||
cp -r commands %{buildroot}%{leapp_python_sitelib}/leapp/cli/
|
||||
@ -413,10 +237,11 @@ rm -rf %{buildroot}%{leapp_python_sitelib}/leapp/cli/commands/tests
|
||||
|
||||
# Remove irrelevant repositories - We don't want to ship them for the particular
|
||||
# RHEL version
|
||||
for i in el7toel8 el8toel9 el9toel10;
|
||||
do
|
||||
[ "$i" != "%{repo_shortname}" ] && rm -rf %{buildroot}%{repositorydir}/system_upgrade/$i
|
||||
done
|
||||
%if 0%{?rhel} == 7
|
||||
rm -rf %{buildroot}%{repositorydir}/system_upgrade/el8toel9
|
||||
%else
|
||||
rm -rf %{buildroot}%{repositorydir}/system_upgrade/el7toel8
|
||||
%endif
|
||||
|
||||
# remove component/unit tests, Makefiles, ... stuff that related to testing only
|
||||
rm -rf %{buildroot}%{repositorydir}/common/actors/testactor
|
||||
@ -424,9 +249,6 @@ find %{buildroot}%{repositorydir}/common -name "test.py" -delete
|
||||
rm -rf `find %{buildroot}%{repositorydir} -name "tests" -type d`
|
||||
find %{buildroot}%{repositorydir} -name "Makefile" -delete
|
||||
find %{buildroot} -name "*.py.orig" -delete
|
||||
# .gitkeep file is used to have a directory in the repo. but we do not want these
|
||||
# files in the resulting RPM
|
||||
find %{buildroot} -name .gitkeep -delete
|
||||
|
||||
for DIRECTORY in $(find %{buildroot}%{repositorydir}/ -mindepth 1 -maxdepth 1 -type d);
|
||||
do
|
||||
@ -445,12 +267,6 @@ done;
|
||||
%endif
|
||||
|
||||
|
||||
%posttrans -n %{lpr_name}-fapolicyd
|
||||
if systemctl is-active --quiet fapolicyd; then
|
||||
systemctl restart fapolicyd
|
||||
fi
|
||||
|
||||
|
||||
%files -n %{lpr_name}
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
@ -461,8 +277,6 @@ fi
|
||||
%dir %{custom_repositorydir}
|
||||
%dir %{leapp_python_sitelib}/leapp/cli/commands
|
||||
%config %{_sysconfdir}/leapp/files/*
|
||||
# uncomment to package installed configs
|
||||
#%%config %%{_sysconfdir}/leapp/actor_conf.d/*
|
||||
%{_sysconfdir}/leapp/repos.d/*
|
||||
%{_sysconfdir}/leapp/transaction/*
|
||||
%{repositorydir}/*
|
||||
@ -472,158 +286,7 @@ fi
|
||||
%files -n %{lpr_name}-deps
|
||||
# no files here
|
||||
|
||||
|
||||
%files -n %{lpr_name}-fapolicyd
|
||||
%attr(644, root, fapolicyd) %config %{_sysconfdir}/fapolicyd/rules.d/31-leapp-repository.rules
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Nov 13 2025 Karolina Kula <kkula@redhat.com> - 0.23.0-2
|
||||
- Requires leapp-framework 6.2+
|
||||
- Detect potentially harmful third party python modules for the target python version
|
||||
- Fix detection of encrypted Ceph OSD containers
|
||||
- Fix unlocking of LUKS devices when applied on non-rootfs file systems
|
||||
- Inhibit the upgrade if pluginpath is configured explicitly in DNF
|
||||
- Introduce `--target-os` option to specify target distribution for possible conversion during the upgrade
|
||||
- Introduce the `--target-version` alias for the `--target` option
|
||||
- Minor changes in logs and reports
|
||||
- Modernize the storage initialization when booting to the upgrade environment
|
||||
- Prevent sssdupdate actor from rising errors that could stop the upgrade
|
||||
- Respect repomapping on CentOS-like distributions
|
||||
- Respect repomapping when converting the system to different Linux distribution
|
||||
- Skip empty lines when parsing dumped DNF config to prevent confusing warning log
|
||||
- Cover JBoss EAP repositories for the upgrade
|
||||
- Update the leapp data files
|
||||
- Resolves: RHEL-25838, RHEL-35446, RHEL-69601, RHEL-71882, RHEL-90098, RHEL-120328, RHEL-123886
|
||||
|
||||
* Thu Aug 14 2025 Karolina Kula <kkula@redhat.com> - 0.23.0-1
|
||||
- Rebase to new upstream 0.23.0
|
||||
- Enable in-place upgrades on CentOS Stream systems
|
||||
- Introduce leapp-upgrade-el8toel9-fapolicyd subpackage with fapolicyd rules for in-place upgrades
|
||||
- Ignore Red Hat subscription-manager actions on non-RHEL distros
|
||||
- Update leapp upgrade data files
|
||||
- Resolves: RHEL-65599, RHEL-67627
|
||||
|
||||
* Fri Jul 18 2025 Karolina Kula <kkula@redhat.com> - 0.22.0-5
|
||||
- Fix broken bootloader on Azure hybrid images for systems previously upgraded from RHEL 7
|
||||
- Load DNF configuration correctly when using DNF libraries
|
||||
- Disable localpkg_gpgcheck during the upgrade if set to allow installation of bundled leapp and leapp-repository deps packages
|
||||
- Add actor with recommendations for upgrade of MySQL
|
||||
- The HybridImage model has been replaced by ConvertGrubenvTask
|
||||
- Check the input format of the target version properly
|
||||
- Resolves: RHEL-5459, RHEL-38255, RHEL-39095, RHEL-47472, RHEL-96238
|
||||
|
||||
* Thu Jun 05 2025 Karolina Kula <kkula@redhat.com> - 0.22.0-4
|
||||
- Fix parsing of the kernel cmdline
|
||||
- Require leapp data with provided_data_streams 4.0+
|
||||
- Resolves: RHEL-67627
|
||||
|
||||
|
||||
* Wed May 14 2025 Petr Stodulka <pstodulk@redhat.com> - 0.22.0-3
|
||||
- Rebuild
|
||||
|
||||
* Tue May 13 2025 Petr Stodulka <pstodulk@redhat.com> - 0.22.0-2
|
||||
- Require leapp-framework >= 6.1
|
||||
- Simplified use of the LiveMode experimental feature with additional enhancements
|
||||
- Fix the check of deprecated PCI devices and drivers
|
||||
- Add RHEL 9.7 product certificates
|
||||
- Gracefully handle CentOS OS versioning style
|
||||
- Introduced the --enable-experimental-feature to simplify use of experimental features
|
||||
- Manage RPM GPG keys during the upgrade respecting used linux distributions
|
||||
- Minor fixes in reports
|
||||
- Prevent a crach during post-upgrade phases when no custom SELinux modules needs to be migrated
|
||||
- Update leapp upgrade data files
|
||||
- Resolves: RHEL-53801, RHEL-77945, RHEL-84978
|
||||
|
||||
* Fri Feb 14 2025 Petr Stodulka <pstodulk@redhat.com> - 0.22.0-1
|
||||
- Rebase to new upstream 0.22.0
|
||||
- Minor updates in generated reports
|
||||
- Resolves: RHEL-67621, RHEL-67719, RHEL-16881
|
||||
|
||||
* Wed Jan 29 2025 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-6
|
||||
- Raise an inhibitor if unsupported target version supplied instead of error
|
||||
- Prevent a possible crash with LiveMode when adding the upgrade boot entry on systems with LVM
|
||||
- Fix the bootloader workaround for upgrades on ARM machines - covering also differences on AWS
|
||||
- Resolves: RHEL-67621, RHEL-51072, RHEL-41193
|
||||
|
||||
* Fri Jan 17 2025 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-5
|
||||
- Fix pes events scanner crashing when there are duplicate packages in the received instructions
|
||||
- Fix pes events scanner not respecting user’s transaction configuration
|
||||
- Fix storage scanner crashing when command outputs contain colon character
|
||||
- Activate LVM VGs with `--sysinit` option to correct the use in the upgrade initramfs
|
||||
- Minor improvements in preupgrade reports
|
||||
- Resolves: RHEL-67621, RHEL-34570, RHEL-44596, RHEL-50076
|
||||
|
||||
* Tue Nov 19 2024 Matej Matuska <mmatuska@redhat.com> - 0.21.0-4
|
||||
- Use net.naming-scheme by default
|
||||
- Resolves: RHEL-23473
|
||||
|
||||
* Mon Nov 18 2024 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-3
|
||||
- Introduce upgrade path 8.10 -> 9.6
|
||||
- Require leapp-framework 6.0+
|
||||
- Update leapp-deps package to satisfy leapp-framework-dependencies 6
|
||||
- Add possibility to use net.naming-scheme during the upgrade
|
||||
- Cap max size of the sparse files to 1TiB for storage with large amount of free space
|
||||
- Enable upgrade for systems with LUKS bound to Clevis with TPM 2.0 token
|
||||
- Adjust resource limitations for leapp to be able to perform the upgrade
|
||||
- Fix problems with the bootloader when upgrading to RHEL 9.6 on ARM
|
||||
- Fix the report when handling broken parsing of kernel cmdline
|
||||
- Generate proper error message instead of ModelViolationError when parsing invalid repository definition
|
||||
- Handle default kernel cmdline when multiple boot entries for the default kernel are defined
|
||||
- Introduce a possibility to configure leapp actors covering RHUI on clouds
|
||||
- Skip checking of (PKI) `directory-hash` dir to speedup the upgrade process and clean logs
|
||||
- Update leapp upgrade data files
|
||||
- Resolves: RHEL-67621, RHEL-57064, RHEL-56251, RHEL-50686, RHEL-41193
|
||||
- Resolves: RHEL-34570, RHEL-26459, RHEL-23473, RHEL-16881, RHEL-3294
|
||||
|
||||
* Mon Aug 19 2024 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-2
|
||||
- Updated SPEC file to drop leapp repositories unrelated to IPU 8 -> 9
|
||||
- Resolves: RHEL-27847
|
||||
|
||||
* Fri Aug 16 2024 Toshio Kuratomi <toshio@fedoraproject.org> - 0.21.0-1
|
||||
- Rebase to new upstream 0.21.0
|
||||
- Updated leapp data files.
|
||||
- Inhibit the upgrade to RHEL 9.5 on ARM architecture due to
|
||||
incompatibility between the RHEL 8 bootloader and RHEL 9.5 kernel.
|
||||
- Introduce experimental upgrades in 'live' mode for the testing.
|
||||
- Resolves: RHEL-27847, RHEL-52993, RHEL-45280, RHEL-49748, RHEL-52186
|
||||
|
||||
* Wed Jul 24 2024 Toshio Kuratomi <toshio@fedoraproject.org> - 0.20.0-5
|
||||
- Improve set_systemd_services_states logging
|
||||
- [IPU 7 -> 8] Fix detection of bootable device on RAID
|
||||
- Fix detection of valid sshd config with internal-sftp subsystem in Leapp
|
||||
- Handle a false positive GPG check error when TargetUserSpaceInfo is missing
|
||||
- Fix failing "update-ca-trust" command caused by missing util-linux package
|
||||
- Improve report when a system is unsupported
|
||||
- Fix handling of versions in RHUI configuration for ELS and SAP upgrades
|
||||
- Add missing RHUI GCP config info for RHEL for SAP
|
||||
- Fix upgrade on aarch64 via RHUI on AWS
|
||||
- Resolves: RHEL-33902, RHEL-38909, RHEL-30573, RHEL-43978, RHEL-39046, RHEL-39047, RHEL-39049
|
||||
|
||||
* Thu May 30 2024 Petr Stodulka <pstodulk@redhat.com> - 0.20.0-4
|
||||
- Enable new upgrade path RHEL 8.10 -> 9.5
|
||||
- Minor updates in reports
|
||||
- Add information about leapp invocation to leapp.db
|
||||
- Resolves: RHEL-27847
|
||||
|
||||
* Mon May 13 2024 Toshio Kuratomi <toshio@fedoraproject.org> - 0.20.0-3
|
||||
- Do not terminate the upgrade dracut module execution if
|
||||
/sysroot/root/tmp_leapp_py3/.leapp_upgrade_failed exists
|
||||
- Several minor improvements in messages printed in console output
|
||||
- Several minor improvements in report and error messages
|
||||
- Fix the parsing of the lscpu output
|
||||
- Fix evaluation of PES data
|
||||
- Target by default always "GA" channel repositories unless a different
|
||||
channel is specified for the leapp execution
|
||||
- Fix creation of the post upgrade report about changes in states of systemd
|
||||
services
|
||||
- Update the device driver deprecation data, fixing invalid fields for some
|
||||
AMD CPUs
|
||||
- Update the default kernel cmdline
|
||||
- Wait for the storage initialization when /usr is on separate file system -
|
||||
covering SAN
|
||||
- Resolves: RHEL-27847, RHEL-35240
|
||||
|
||||
* Tue Feb 20 2024 Petr Stodulka <pstodulk@redhat.com> - 0.20.0-2
|
||||
- Fallback to original RHUI solution on AWS to fix issues caused by changes in RHUI client
|
||||
- Resolves: RHEL-16729
|
||||
|
||||
Loading…
Reference in New Issue
Block a user