IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 10, 2013, 2:14:21 PM (13 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20130904
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904

  • branches/eam_branches/ipp-20130904/ippScripts/scripts/rawcheck.pl

    r36253 r36370  
    8181my $regtool_cmd = "$regtool -processedimfile -exp_id $exp_id -dbname $dbname";
    8282my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    83     run(command => $regtool_cmd, verbose => 1);
     83    run(command => $regtool_cmd, verbose => 0);
    8484unless ($success) {
    8585    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    133133            $existance[$i] = 1;
    134134            $existing_copies++;
    135             my $fh;
    136             open($fh,$files[$i]);
    137             $md5sums[$i] = Digest::MD5->new->addfile($fh)->hexdigest;
     135            $md5sums[$i] = local_md5sum($files[$i]);
     136#           my $fh;
     137#           open($fh,$files[$i]);
     138#           $md5sums[$i] = Digest::MD5->new->addfile($fh)->hexdigest;
     139#           close($fh);
    138140            $md5sum_uniq{$md5sums[$i]} = 1;
    139             close($fh);
     141
    140142        }
    141143        else {
     
    223225# Begin my best validation thought
    224226        {
    225             my $fh;
    226             open($fh,$files[0]);
    227             my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;
    228             close($fh);
     227            my $tmpmd5 = local_md5sum($files[0]);
     228#           my $fh;
     229#           open($fh,$files[0]);
     230#           my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;
     231#           close($fh);
    229232            if ($tmpmd5 ne $md5sum) {
    230233                die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
     
    257260                my $uris = $neb->find_instances($key,$rep_vol);
    258261                @$uris = map {URI->new($_)->file if $_} @$uris;
    259                 my $fh;
    260                 open($fh,${ $uris }[0]);
    261                 my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;
    262                 close($fh);
     262                my $tmpmd5 = local_md5sum(${ $uris }[0]);
     263#               my $fh;
     264#               open($fh,${ $uris }[0]);
     265#               my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;
     266#               close($fh);
    263267                if ($tmpmd5 ne $md5sum) {
    264268                    die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
     
    282286
    283287#               print $uris . " " . ${ $uris }[0] . " \n";
    284                 my $fh;
    285                 open($fh,${ $uris }[0]);
    286 
    287                 my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;
    288                 close($fh);
     288                my $tmpmd5 = local_md5sum(${ $uris }[0]);
     289#               my $fh;
     290#               open($fh,${ $uris }[0]);
     291#               my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;
     292#               close($fh);
    289293                if ($tmpmd5 ne $md5sum) {
    290294                    die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
     
    318322}
    319323
     324sub local_md5sum {
     325    my $filename = shift;
     326    my $volume   = (split /\//, $filename)[2];
     327    my $host     = $volume;
     328    $host =~ s/\.\d//;
     329#    print "$filename $host $volume\n";
     330    my $response = `ssh $host md5sum $filename`;
     331    chomp($response);
     332    my ($sum, undef) = split /\s+/, $response;
     333    unless(defined($sum)) {
     334        my_die("Failed to calculate md5sum locally. $filename $host $volume");
     335    }
     336    return($sum);
     337}
     338
     339
    320340sub parse_volume {
    321341    my $filename = shift(@_);
     
    341361}
    342362
    343        
    344 
    345 
    346363sub my_die {
    347364    my $msg = shift(@_);
Note: See TracChangeset for help on using the changeset viewer.