Changeset 2266 in /cluster/svnroot


Ignore:
Timestamp:
Mar 21, 2010 9:30:03 PM (11 years ago)
Author:
skylar
Message:

adding failure alerts (#475)

Location:
bccd-ng/branches/skylar-devel
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar-devel/packages/usr/local/lib/site_perl/5.10.0/Bccd/TestDb.pm

    r1437 r2266  
    2020
    2121    @ISA = qw(Exporter);
    22     @EXPORT_OK = qw( &open_db &insert_results );
     22    @EXPORT_OK = qw( &open_db &insert_results &check_build_failure );
    2323}
    2424
     
    101101}
    102102
     103sub check_build_failure {
     104        my($dbh) = @_;
     105
     106        my $sql = "SELECT description FROM last_build";
     107
     108    my $sth = $dbh->prepare($sql) || die "Prepare error: ($sql) $DBI::errstr\n";
     109        my $status = $sth->execute()
     110                || die "Execute error: ($sql) $DBI::errstr\n";
     111
     112        my @select = $sth->fetchrow_array();
     113        if($select[0] ne 'SUCCESS') {
     114                return undef;
     115        }
     116
     117        return 0;
     118}
     119
    1031201;
Note: See TracChangeset for help on using the changeset viewer.