Skip to content

Commit 19d9739

Browse files
authored
Merge pull request #30 from cloudlinux/clos-3187-cloudlinux-8
CLOS-3187: Add support for CloudLinux 8 to 9 migrations
2 parents 7c79b3b + c282401 commit 19d9739

File tree

9 files changed

+29
-15
lines changed

9 files changed

+29
-15
lines changed

packaging/leapp-repository.spec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ rm -rf %{buildroot}%{leapp_python_sitelib}/leapp/cli/commands/tests
240240
rm -rf %{buildroot}%{repositorydir}/system_upgrade/el8toel9
241241
%else
242242
rm -rf %{buildroot}%{repositorydir}/system_upgrade/el7toel8
243-
# CloudLinux migration only supports el7 to el8
244-
rm -rf %{buildroot}%{repositorydir}/system_upgrade/cloudlinux
245243
%endif
246244

247245
# remove component/unit tests, Makefiles, ... stuff that related to testing only
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name": "cloudlinux", "id": "427ddd90-9b5e-4400-b21e-73d77791f175", "repos": ["644900a5-c347-43a3-bfab-f448f46d9647", "c47fbc3d-ae38-416e-9176-7163d67d94f6", "efcf9016-f2d1-4609-9329-a298e6587b3c"]}
1+
{"name": "cloudlinux", "id": "427ddd90-9b5e-4400-b21e-73d77791f175", "repos": ["644900a5-c347-43a3-bfab-f448f46d9647", "efcf9016-f2d1-4609-9329-a298e6587b3c"]}

repos/system_upgrade/cloudlinux/actors/checkrhnclienttools/actor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class CheckRhnClientToolsVersion(Actor):
2727

2828
@run_on_cloudlinux
2929
def process(self):
30+
# todo: (CLOS-3202) update the actor
31+
return
32+
3033
title, summary, remediation = None, None, None
3134
# ex:
3235
# Version : 2.0.2

repos/system_upgrade/cloudlinux/actors/clearpackageconflicts/actor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,6 @@ def lua_cjson_handle(self):
9797

9898
@run_on_cloudlinux
9999
def process(self):
100-
self.rpm_lookup = {rpm for rpm in self.consume(InstalledRPM)}
100+
# todo: (CLOS-3205) investigate why set is needed here
101+
self.rpm_lookup = [rpm for rpm in self.consume(InstalledRPM)]
101102
self.alt_python37_handle()

repos/system_upgrade/cloudlinux/actors/switchclnchanneldownload/actor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from leapp.libraries.common.cln_switch import cln_switch, get_target_userspace_path
1010
from leapp import reporting
1111
from leapp.reporting import Report
12+
from leapp.libraries.common.config.version import get_target_major_version
1213

1314

1415

@@ -29,7 +30,7 @@ class SwitchClnChannelDownload(Actor):
2930
@run_on_cloudlinux
3031
def process(self):
3132
try:
32-
cln_switch(target=8)
33+
cln_switch(target=int(get_target_major_version()))
3334
except CalledProcessError as e:
3435
reporting.create_report(
3536
[

repos/system_upgrade/cloudlinux/actors/switchclnchannelreset/actor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from leapp.libraries.stdlib import CalledProcessError
55
from leapp.libraries.common.cllaunch import run_on_cloudlinux
66
from leapp.libraries.common.cln_switch import cln_switch
7+
from leapp.libraries.common.config.version import get_source_major_version
78
from leapp import reporting
89
from leapp.reporting import Report
910

@@ -21,12 +22,12 @@ class SwitchClnChannelReset(Actor):
2122
@run_on_cloudlinux
2223
def process(self):
2324
try:
24-
cln_switch(target=7)
25+
cln_switch(target=get_source_major_version())
2526
except CalledProcessError as e:
2627
reporting.create_report(
2728
[
2829
reporting.Title(
29-
"Failed to switch CloudLinux Network channel from to 7."
30+
"Failed to switch CloudLinux Network channel."
3031
),
3132
reporting.Summary(
3233
"Command {} failed with exit code {}."

repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ def _handle_transaction_err_msg_size(err):
215215

216216

217217
def enable_spacewalk_module(context):
218-
enabled_repos = ["cloudlinux8-baseos"]
219218
target_major_version = get_target_major_version()
219+
enabled_repos = ["cloudlinux{version}-baseos".format(version=target_major_version)]
220220
repos_opt = [['--enablerepo', repo] for repo in enabled_repos]
221221
repos_opt = list(itertools.chain(*repos_opt))
222222

@@ -260,10 +260,18 @@ def prepare_target_userspace(context, userspace_dir, enabled_repos, packages):
260260
_import_gpg_keys(context, install_root_dir, target_major_version)
261261

262262
api.current_logger().debug('Installing cloudlinux-release')
263-
context.call(['rpm', '--import', 'https://repo.cloudlinux.com/cloudlinux/security/RPM-GPG-KEY-CloudLinux'], callback_raw=utils.logging_handler)
264-
context.call(['dnf', '-y', 'localinstall', 'https://repo.cloudlinux.com/cloudlinux/migrate/release-files/cloudlinux/8/x86_64/cloudlinux8-release-current.x86_64.rpm'], callback_raw=utils.logging_handler)
265-
266-
enable_spacewalk_module(context)
263+
context.call(['rpm', '--import', 'https://repo.cloudlinux.com/cloudlinux/security/RPM-GPG-KEY-CloudLinux'],
264+
callback_raw=utils.logging_handler)
265+
cloudlinux_release_url = (
266+
'https://repo.cloudlinux.com/cloudlinux/migrate/release-files'
267+
'/cloudlinux/{version}/x86_64/cloudlinux{version}-release-current.x86_64.rpm'
268+
).format(version=target_major_version)
269+
context.call(['dnf', '-y', 'localinstall', cloudlinux_release_url],
270+
callback_raw=utils.logging_handler)
271+
272+
# cloudlinux 9 does not have modular packages
273+
if target_major_version == '8':
274+
enable_spacewalk_module(context)
267275

268276
api.current_logger().debug('Installing packages into target userspace: {}'.format(packages))
269277

@@ -333,7 +341,7 @@ def prepare_target_userspace(context, userspace_dir, enabled_repos, packages):
333341
# transaction check phase is done - so the preupgrade checks won't affect the host system.
334342
# The 'switch_cln_channel_download' actor should take care of switching the channel back to the CL8 channel
335343
# when it's time to download the upgrade packages.
336-
cln_switch(target=8)
344+
cln_switch(target=int(target_major_version))
337345

338346

339347
def _query_rpm_for_pkg_files(context, pkgs):

repos/system_upgrade/common/libraries/config/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
_SUPPORTED_VERSIONS = {
1717
# Note: 'rhel-alt' is detected when on 'rhel' with kernel 4.x
1818
'7': {'rhel': ['7.9'], 'rhel-alt': [], 'rhel-saphana': ['7.9'], 'centos': ['7.9'], 'eurolinux': ['7.9'], 'ol': ['7.9'], 'scientific': ['7.9'], 'cloudlinux': ['7.9']},
19-
'8': {'rhel': ['8.8', '8.10'], 'rhel-saphana': ['8.8', '8.10'], 'centos': ['8.5', '8.999'], 'almalinux': ['8.6', '8.7', '8.8', '8.9', '8.10'], 'eurolinux': ['8.6', '8.7', '8.8', '8.9', '8.10'], 'ol': ['8.6', '8.7', '8.8', '8.9', '8.10'], 'rocky': ['8.6', '8.7', '8.8', '8.9', '8.10']},
19+
'8': {'rhel': ['8.8', '8.10'], 'rhel-saphana': ['8.8', '8.10'], 'centos': ['8.5', '8.999'], 'almalinux': ['8.6', '8.7', '8.8', '8.9', '8.10'], 'eurolinux': ['8.6', '8.7', '8.8', '8.9', '8.10'], 'ol': ['8.6', '8.7', '8.8', '8.9', '8.10'], 'rocky': ['8.6', '8.7', '8.8', '8.9', '8.10'], 'cloudlinux': ['8.10']},
2020
}
2121

2222

repos/system_upgrade/el8toel9/actors/checkdeprecatedrpmsignature/actor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ class CheckDeprecatedRPMSignature(Actor):
3737
tags = (IPUWorkflowTag, ChecksPhaseTag)
3838

3939
def process(self):
40-
checkdeprecatedrpmsignature.process()
40+
# todo: (CLOS-3206) resign all packages and turn the check back on
41+
# checkdeprecatedrpmsignature.process()
42+
pass

0 commit comments

Comments
 (0)