From 993f5d284ae9198c804da1751468e790ee61096f Mon Sep 17 00:00:00 2001 From: Travis Holloway Date: Wed, 3 Jul 2024 15:55:05 -0500 Subject: [PATCH] Remove support for CloudLinux Case RE-500: Remove support for CloudLinux Changelog: --- elevate-cpanel | 18 ++++++++++++++++-- lib/Elevate/Blockers/Distros.pm | 17 +++++++++++++++-- lib/Elevate/OS/CloudLinux7.pm | 2 ++ t/blocker-Distros.t | 9 ++++++++- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/elevate-cpanel b/elevate-cpanel index 3b9828b1..d4224ac0 100755 --- a/elevate-cpanel +++ b/elevate-cpanel @@ -925,7 +925,12 @@ EOS } sub _blocker_os_is_not_supported ($self) { - Elevate::OS::is_supported(); # dies + my $is_supported = Elevate::OS::is_supported(); # dies + unless ($is_supported) { + return $self->has_blocker( <<~'EOS' ); + elevate-cpanel for CloudLinux 7 has been disabled due to problems with the upstream leapp package. See https://go.cpanel.net/elevate-cloudlinux-disabled for more information. The stability of your upgrade is our highest priority. We will re-enable it when this has been resolved. + EOS + } return 0; } @@ -954,7 +959,15 @@ EOS sub bail_out_on_inappropriate_distro () { Elevate::OS::clear_cache(); - Elevate::OS::is_supported(); # dies + my $is_supported = Elevate::OS::is_supported(); # dies + + unless ($is_supported) { + FATAL( <<~'EOS' ); + elevate-cpanel for CloudLinux 7 has been disabled due to problems with the upstream leapp package. See https://go.cpanel.net/elevate-cloudlinux-disabled for more information. The stability of your upgrade is our highest priority. We will re-enable it when this has been resolved. + EOS + exit 1; ## no critic(Cpanel::NoExitsFromSubroutines) + } + return; } @@ -5591,6 +5604,7 @@ EOS our @ISA; BEGIN { push @ISA, qw(Elevate::OS::RHEL); } + use constant is_supported => 0; use constant default_upgrade_to => 'CloudLinux'; use constant ea_alias => 'CloudLinux_8'; use constant elevate_rpm_url => 'https://repo.cloudlinux.com/elevate/elevate-release-latest-el7.noarch.rpm'; diff --git a/lib/Elevate/Blockers/Distros.pm b/lib/Elevate/Blockers/Distros.pm index 30688bc0..046a4948 100644 --- a/lib/Elevate/Blockers/Distros.pm +++ b/lib/Elevate/Blockers/Distros.pm @@ -39,7 +39,12 @@ sub check ($self) { } sub _blocker_os_is_not_supported ($self) { - Elevate::OS::is_supported(); # dies + my $is_supported = Elevate::OS::is_supported(); # dies + unless ($is_supported) { + return $self->has_blocker( <<~'EOS' ); + elevate-cpanel for CloudLinux 7 has been disabled due to problems with the upstream leapp package. See https://go.cpanel.net/elevate-cloudlinux-disabled for more information. The stability of your upgrade is our highest priority. We will re-enable it when this has been resolved. + EOS + } return 0; } @@ -75,7 +80,15 @@ upgrade via this script. Never allow a cache to be used here. sub bail_out_on_inappropriate_distro () { Elevate::OS::clear_cache(); - Elevate::OS::is_supported(); # dies + my $is_supported = Elevate::OS::is_supported(); # dies + + unless ($is_supported) { + FATAL( <<~'EOS' ); + elevate-cpanel for CloudLinux 7 has been disabled due to problems with the upstream leapp package. See https://go.cpanel.net/elevate-cloudlinux-disabled for more information. The stability of your upgrade is our highest priority. We will re-enable it when this has been resolved. + EOS + exit 1; ## no critic(Cpanel::NoExitsFromSubroutines) + } + return; } diff --git a/lib/Elevate/OS/CloudLinux7.pm b/lib/Elevate/OS/CloudLinux7.pm index a6f97796..bfddedca 100644 --- a/lib/Elevate/OS/CloudLinux7.pm +++ b/lib/Elevate/OS/CloudLinux7.pm @@ -14,6 +14,8 @@ use Log::Log4perl qw(:easy); use parent 'Elevate::OS::RHEL'; +# RE-500: temporarily disable until upstream leapp bug is resolved +use constant is_supported => 0; use constant default_upgrade_to => 'CloudLinux'; use constant ea_alias => 'CloudLinux_8'; use constant elevate_rpm_url => 'https://repo.cloudlinux.com/elevate/elevate-release-latest-el7.noarch.rpm'; diff --git a/t/blocker-Distros.t b/t/blocker-Distros.t index 8645511f..7b399f51 100644 --- a/t/blocker-Distros.t +++ b/t/blocker-Distros.t @@ -58,7 +58,14 @@ my $distros = $cpev->get_blocker('Distros'); Cpanel::OS::clear_cache_after_cloudlinux_update(); unmock_os(); $f = Test::MockFile->symlink( 'linux|cloudlinux|7|9|2009', '/var/cpanel/caches/Cpanel-OS' ); - is( $distros->check(), 0, 'CL7 is supported.' ); + like( + $distros->check(), + { + id => 'Elevate::Blockers::Distros::_blocker_os_is_not_supported', + msg => qr/elevate-cpanel for CloudLinux 7 has been disabled due to problems with the upstream leapp package/, + }, + 'CL7 is supported.', + ); undef $f; Cpanel::OS::clear_cache_after_cloudlinux_update();