From fe7af6273e6613e442400ed6b9900e983fbe04aa Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 31 Oct 2011 10:28:51 +0100 Subject: [PATCH] Bug fixes --- brun | 2 +- lib/BEX/Job.pm | 2 +- lib/BEX/Queue.pm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/brun b/brun index 760bf9c..aa8a51a 100755 --- a/brun +++ b/brun @@ -106,7 +106,7 @@ for my $mach (@machines) { }; print "### Running $jid (", $job->attr('Subject'), ") on $mach ###\n"; $ping //= ping_machine($mach); - my $s, $msg; + my ($s, $msg); if (!$ping) { ($s, $msg) = ('NOPING', 'Does not ping'); } else { diff --git a/lib/BEX/Job.pm b/lib/BEX/Job.pm index 16e55f5..7bd7a8f 100644 --- a/lib/BEX/Job.pm +++ b/lib/BEX/Job.pm @@ -47,7 +47,7 @@ sub new_from_file($$;$) { } sub id($) { - return $_->{'ID'}; + return $_[0]->{'ID'}; } sub attr($$;$) { diff --git a/lib/BEX/Queue.pm b/lib/BEX/Queue.pm index 429c7a4..9b93047 100644 --- a/lib/BEX/Queue.pm +++ b/lib/BEX/Queue.pm @@ -26,7 +26,7 @@ sub new($;$) { # Most actions have to be logged by the caller sub log($$$$;$) { my ($queue, $mach, $jid, $stat, $msg) = @_; - my $fh = $queue->{'LogFH'} //= new IO::File '>>', $queue->{'Name'} . '/log' or die "Cannot open log: $!"; + my $fh = $queue->{'LogFH'} //= new IO::File $queue->{'Name'} . '/log', '>>' or die "Cannot open log: $!"; my $m = join(" ", POSIX::strftime("%Y-%m-%d %H:%M:%S", localtime), $mach, $jid, $stat); $m .= " $msg" if defined $msg; print $fh "$m\n"; -- 2.39.2