Skip to content

Commit 6514dce

Browse files
committed
switch cln channel version according to target os version
1 parent 1e718b2 commit 6514dce

File tree

3 files changed

+6
-4
lines changed
  • repos/system_upgrade

3 files changed

+6
-4
lines changed

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def prepare_target_userspace(context, userspace_dir, enabled_repos, packages):
340340
# transaction check phase is done - so the preupgrade checks won't affect the host system.
341341
# The 'switch_cln_channel_download' actor should take care of switching the channel back to the CL8 channel
342342
# when it's time to download the upgrade packages.
343-
cln_switch(target=8)
343+
cln_switch(target=int(get_target_major_version()))
344344

345345

346346
def _query_rpm_for_pkg_files(context, pkgs):

0 commit comments

Comments
 (0)