Changeset 38364
- Timestamp:
- Jun 4, 2015, 12:20:39 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tools/stsci_disks/p1_clear.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/stsci_disks/p1_clear.pl
r38361 r38364 92 92 my @vols; 93 93 my @md5sums; 94 94 my @skip; 95 95 # Pre scan 96 96 for (my $i = 0; $i <= $#files; $i++) { … … 126 126 127 127 $md5sums[$i] = local_md5sum($f); 128 unless (defined($md5sums[$i])) { 129 die("Failed to calculate md5sum locally. $f "); 130 } 128 131 # Get a target 129 132 $vols[$i] = get_volume($keys[$i]); … … 133 136 134 137 # 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}"); 136 139 if ($#{ $local_uris } == -1) { 137 140 $vols[$i] = undef(); … … 159 162 # Do a replication pass 160 163 for (my $i = 0; $i <= $#files; $i++) { 164 $skip[$i] = 0; 161 165 if ($belongs[$i] == 0) { 162 166 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 $@; } 165 171 } 166 172 else { … … 180 186 # Do the check pass 181 187 for (my $i = 0; $i <= $#files; $i++) { 188 if ($skip[$i] == 1) { next; } 182 189 my $uri; 183 190 if ($belongs[$i] == 0) { … … 193 200 194 201 my $tmpmd5 = local_md5sum($uri); 202 unless (defined($tmpmd5)) { 203 next; 204 } 195 205 if ($tmpmd5 ne $md5sums[$i]) { 196 206 if (defined($vols[$i])) { … … 311 321 chomp($response); 312 322 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 } 316 326 return($sum); 317 327 }
Note:
See TracChangeset
for help on using the changeset viewer.
