Skip to content

Commit

Permalink
worker_command_tester: improve backend handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jun 3, 2024
1 parent 02ff48f commit e893c35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/worker_command_tester
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ use Pod::Usage;
use Getopt::Long;
use IO::Select ();
use IPC::Open3 qw/open3/;
use Thruk::Constants ':backend_handling';
use Thruk::Utils::CLI;
use Thruk::Utils::IO ();
use Thruk::Utils::Log qw/:all/;
Expand Down Expand Up @@ -137,6 +138,7 @@ sub run {
my $cli = Thruk::Utils::CLI->new($options);
my $c = $cli->get_c();
Thruk::Action::AddDefaults::add_defaults($c);
$c->stash->{'backend_errors_handling'} = DIE;

$self->{'c'} = $c;
$self->{'opt'} = $opt;
Expand Down Expand Up @@ -202,7 +204,7 @@ sub _run_checks {
exit(1);
};

my $t1 = time();
my $t1 = time();
my $num_jobs = scalar @{$jobs};
my $numsize = length("$num_jobs");
my $nr = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/Thruk/Backend/Manager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ expand a command line with host/service data

sub expand_command {
my( $self, %data ) = @_;
croak("no host") unless defined $data{'host'};
croak("no host") unless defined $data{'host'};
my $host = $data{'host'};
my $service = $data{'service'};
my $command = $data{'command'}; # optional reference to a command object from the commands tabls
Expand Down

0 comments on commit e893c35

Please sign in to comment.