Skip to content

Commit

Permalink
Merge pull request #340 from cPholloway/gh332
Browse files Browse the repository at this point in the history
Teach should_run_leapp to check for the CLI option
  • Loading branch information
toddr authored Jan 9, 2024
2 parents 55850f6 + f073c1f commit 657c65d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion elevate-cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -6360,7 +6360,9 @@ sub setup_answer_file {
sub should_run_leapp ($self) {

# we store the no_leapp option, but prefer using a positive check instead
my $no_leapp = read_stage_file( 'no_leapp', 0 );
# we need to check to see if the no-leapp option is passed via CLI here too in order
# to allow users to run this script with the '--check --no-leapp' options
my $no_leapp = read_stage_file( 'no_leapp', 0 ) || $self->getopt('no-leapp');
return !$no_leapp;
}

Expand Down
4 changes: 3 additions & 1 deletion script/elevate-cpanel.PL
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,9 @@ sub setup_answer_file {
sub should_run_leapp ($self) {

# we store the no_leapp option, but prefer using a positive check instead
my $no_leapp = read_stage_file( 'no_leapp', 0 );
# we need to check to see if the no-leapp option is passed via CLI here too in order
# to allow users to run this script with the '--check --no-leapp' options
my $no_leapp = read_stage_file( 'no_leapp', 0 ) || $self->getopt('no-leapp');
return !$no_leapp;
}

Expand Down
3 changes: 2 additions & 1 deletion t/leapp_upgrade.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ $mock_elevate->redefine(
setup_answer_file => sub { # cannot use Test::MockFile with system touch...
note "mocked setup_answer_file";
return;
}
},
getopt => sub { return; },
);

my $mock_elevate_file = Test::MockFile->file('/var/cpanel/elevate');
Expand Down

0 comments on commit 657c65d

Please sign in to comment.