Skip to content

Commit

Permalink
Merge pull request #498 from timmullin/RE-43
Browse files Browse the repository at this point in the history
Do not block on Panopta or FortiMonitor
  • Loading branch information
toddr authored Aug 20, 2024
2 parents 1362b87 + fb7386f commit d1673d1
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
36 changes: 36 additions & 0 deletions elevate-cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ BEGIN { # Suppress load of all of these at earliest point.
$INC{'Elevate/Components/DatabaseUpgrade.pm'} = 'script/elevate-cpanel.PL.static';
$INC{'Elevate/Components/ELS.pm'} = 'script/elevate-cpanel.PL.static';
$INC{'Elevate/Components/R1Soft.pm'} = 'script/elevate-cpanel.PL.static';
$INC{'Elevate/Components/Panopta.pm'} = 'script/elevate-cpanel.PL.static';
$INC{'Elevate/OS.pm'} = 'script/elevate-cpanel.PL.static';
$INC{'Elevate/OS/CentOS7.pm'} = 'script/elevate-cpanel.PL.static';
$INC{'Elevate/OS/CloudLinux7.pm'} = 'script/elevate-cpanel.PL.static';
Expand Down Expand Up @@ -5915,6 +5916,37 @@ EOS

} # --- END lib/Elevate/Components/R1Soft.pm

{ # --- BEGIN lib/Elevate/Components/Panopta.pm

package Elevate::Components::Panopta;

use cPstrict;

use Cpanel::Pkgr ();

# use Elevate::Components::Base();
our @ISA;
BEGIN { push @ISA, qw(Elevate::Components::Base); }

sub pre_leapp ($self) {

if ( Cpanel::Pkgr::is_installed('panopta-agent') ) {

$self->yum->remove('panopta-agent');
}

return;
}

sub post_leapp ($self) {

return;
}

1;

} # --- END lib/Elevate/Components/Panopta.pm

{ # --- BEGIN lib/Elevate/OS.pm

package Elevate::OS;
Expand Down Expand Up @@ -6175,6 +6207,8 @@ EOS
'kernelcare',
'updates',
'r1soft',
qr/^panopta(?:\.repo)?$/,
qr/^fortimonitor(?:\.repo)?$/,
qr/^wp-toolkit-(?:cpanel|thirdparties)$/,
),
vetted_mysql_yum_repo_ids;
Expand Down Expand Up @@ -8472,6 +8506,7 @@ use Elevate::Components::AutoSSL ();
use Elevate::Components::DatabaseUpgrade ();
use Elevate::Components::ELS ();
use Elevate::Components::R1Soft ();
use Elevate::Components::Panopta ();

# - fatpack OS
use Elevate::OS ();
Expand Down Expand Up @@ -9514,6 +9549,7 @@ sub run_final_components_pre_leapp ($self) {
$self->run_component_once( 'AbsoluteSymlinks' => 'pre_leapp' );
$self->run_component_once( 'ELS' => 'pre_leapp' );
$self->run_component_once( 'R1Soft' => 'pre_leapp' );
$self->run_component_once( 'Panopta' => 'pre_leapp' );
$self->run_component_once( 'RpmDB' => 'pre_leapp' ); # remove the RPMs last

return;
Expand Down
38 changes: 38 additions & 0 deletions lib/Elevate/Components/Panopta.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package Elevate::Components::Panopta;

=encoding utf-8
=head1 NAME
Elevate::Components::Panopta
Handle situation where the Panopta agent is installed
Before leapp:
Uninstall the Panopta agent since it is deprecated and
not compatible with Elevate
=cut

use cPstrict;

use Cpanel::Pkgr ();

use parent qw{Elevate::Components::Base};

sub pre_leapp ($self) {

if ( Cpanel::Pkgr::is_installed('panopta-agent') ) {

$self->yum->remove('panopta-agent');
}

return;
}

sub post_leapp ($self) {

return;
}

1;
2 changes: 2 additions & 0 deletions lib/Elevate/OS/RHEL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ use constant vetted_yum_repo => (
'kernelcare',
'updates',
'r1soft',
qr/^panopta(?:\.repo)?$/,
qr/^fortimonitor(?:\.repo)?$/,
qr/^wp-toolkit-(?:cpanel|thirdparties)$/,
),
vetted_mysql_yum_repo_ids;
Expand Down
2 changes: 2 additions & 0 deletions script/elevate-cpanel.PL
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ use Elevate::Components::AutoSSL ();
use Elevate::Components::DatabaseUpgrade ();
use Elevate::Components::ELS ();
use Elevate::Components::R1Soft ();
use Elevate::Components::Panopta ();

# - fatpack OS
use Elevate::OS ();
Expand Down Expand Up @@ -1331,6 +1332,7 @@ sub run_final_components_pre_leapp ($self) {
$self->run_component_once( 'AbsoluteSymlinks' => 'pre_leapp' );
$self->run_component_once( 'ELS' => 'pre_leapp' );
$self->run_component_once( 'R1Soft' => 'pre_leapp' );
$self->run_component_once( 'Panopta' => 'pre_leapp' );
$self->run_component_once( 'RpmDB' => 'pre_leapp' ); # remove the RPMs last

return;
Expand Down

0 comments on commit d1673d1

Please sign in to comment.