IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38364


Ignore:
Timestamp:
Jun 4, 2015, 12:20:39 PM (11 years ago)
Author:
watersc1
Message:

Not sure why it wasn't happy before, but I've made the "is an instance supposed to be on this volume" check more explicit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/stsci_disks/p1_clear.pl

    r38361 r38364  
    9292    my @vols;
    9393    my @md5sums;
    94 
     94    my @skip;
    9595# Pre scan
    9696    for (my $i = 0; $i <= $#files; $i++) {
     
    126126
    127127            $md5sums[$i] = local_md5sum($f);
     128            unless (defined($md5sums[$i])) {
     129                die("Failed to calculate md5sum locally. $f ");
     130            }
    128131            # Get a target
    129132            $vols[$i] = get_volume($keys[$i]);
     
    133136           
    134137            # Check that we actually have a key on the host we're checking.
    135             my $local_uris = $neb->find_instances($keys[$i],"~" . $host . "." . $volume);
     138            my $local_uris = $neb->find_instances($keys[$i],"~${host}.${volume}");
    136139            if ($#{ $local_uris } == -1) {
    137140                $vols[$i] = undef();
     
    159162# Do a replication pass
    160163    for (my $i = 0; $i <= $#files; $i++) {
     164        $skip[$i] = 0;
    161165        if ($belongs[$i] == 0) {
    162166            if (defined($vols[$i])) {
    163                 $neb->replicate($keys[$i],$vols[$i]) or die "failed to replicate a copy to the backup node";
    164                 if ($@) { die $@; }
     167                unless ($neb->replicate($keys[$i],$vols[$i])) {
     168                    $skip[$i] = 1;
     169                }
     170#               if ($@) { die $@; }
    165171            }
    166172            else {
     
    180186# Do the check pass
    181187    for (my $i = 0; $i <= $#files; $i++) {
     188        if ($skip[$i] == 1) { next; }
    182189        my $uri;
    183190        if ($belongs[$i] == 0) {
     
    193200
    194201            my $tmpmd5 = local_md5sum($uri);
     202            unless (defined($tmpmd5)) {
     203                next;
     204            }
    195205            if ($tmpmd5 ne $md5sums[$i]) {
    196206                if (defined($vols[$i])) {
     
    311321    chomp($response);
    312322    my ($sum, undef) = split /\s+/, $response;
    313     unless(defined($sum)) {
    314         die("Failed to calculate md5sum locally. $filename $host $volume");
    315     }
     323     unless(defined($sum)) {
     324         warn("Failed to calculate md5sum locally. $filename $host $volume");
     325     }
    316326    return($sum);
    317327}
Note: See TracChangeset for help on using the changeset viewer.