]> mj.ucw.cz Git - bex.git/commitdiff
Bug fixes
authorMartin Mares <mj@ucw.cz>
Mon, 31 Oct 2011 09:28:51 +0000 (10:28 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 31 Oct 2011 09:28:51 +0000 (10:28 +0100)
brun
lib/BEX/Job.pm
lib/BEX/Queue.pm

diff --git a/brun b/brun
index 760bf9ca172f1f7e8f0bcaf92df7c64109bb0386..aa8a51af6db6268e35725f9f2abff8d3b1cac4c8 100755 (executable)
--- 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 {
index 16e55f519b3e835cddeb8e3dbc2ebeb7a1a58d87..7bd7a8f80277ffbb9aec78e18689334483b4e894 100644 (file)
@@ -47,7 +47,7 @@ sub new_from_file($$;$) {
 }
 
 sub id($) {
-       return $_->{'ID'};
+       return $_[0]->{'ID'};
 }
 
 sub attr($$;$) {
index 429c7a4ab00857f803a22c8cc31bf4a10b5a710d..9b93047c1b40fbbf246413145f1bf58eaeccbc4c 100644 (file)
@@ -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";