From fc1d6b97e1e49e16134e97bdb51ae265d4b13e14 Mon Sep 17 00:00:00 2001 From: Tabulo Date: Mon, 27 Sep 2021 00:37:40 +0200 Subject: [PATCH] Fix #1508 w/ some code cleanup. All tests still pass. --- lib/Rex/Commands.pm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/Rex/Commands.pm b/lib/Rex/Commands.pm index fc0e03a81..bd9fd170c 100644 --- a/lib/Rex/Commands.pm +++ b/lib/Rex/Commands.pm @@ -1064,11 +1064,7 @@ sub needs { my $task_o = $tl->get_task($task); my $task_name = $task_o->name; my $suffix = $self . ":"; - if ( @args && grep ( /^\Q$task_name\E$/, @args ) ) { - Rex::Logger::debug( "Calling " . $task_o->name ); - $task_o->run( "", params => \%task_opts, args => \@task_args ); - } - elsif ( !@args ) { + if ( !@args or @args && grep ( /^\Q$task_name\E$/, @args ) ) { Rex::Logger::debug( "Calling " . $task_o->name ); $task_o->run( "", params => \%task_opts, args => \@task_args ); }