Changeset 36289
- Timestamp:
- Nov 18, 2013, 4:41:16 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/rawcheck.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/rawcheck.pl
r36231 r36289 81 81 my $regtool_cmd = "$regtool -processedimfile -exp_id $exp_id -dbname $dbname"; 82 82 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 83 run(command => $regtool_cmd, verbose => 1);83 run(command => $regtool_cmd, verbose => 0); 84 84 unless ($success) { 85 85 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 133 133 $existance[$i] = 1; 134 134 $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); 138 140 $md5sum_uniq{$md5sums[$i]} = 1; 139 close($fh); 141 140 142 } 141 143 else { … … 223 225 # Begin my best validation thought 224 226 { 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); 229 232 if ($tmpmd5 ne $md5sum) { 230 233 die "Post-replication md5sum does not match! $tmpmd5 != $md5sum"; … … 257 260 my $uris = $neb->find_instances($key,$rep_vol); 258 261 @$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); 263 267 if ($tmpmd5 ne $md5sum) { 264 268 die "Post-replication md5sum does not match! $tmpmd5 != $md5sum"; … … 282 286 283 287 # 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); 289 293 if ($tmpmd5 ne $md5sum) { 290 294 die "Post-replication md5sum does not match! $tmpmd5 != $md5sum"; … … 318 322 } 319 323 324 sub 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 320 340 sub parse_volume { 321 341 my $filename = shift(@_); … … 341 361 } 342 362 343 344 345 346 363 sub my_die { 347 364 my $msg = shift(@_);
Note:
See TracChangeset
for help on using the changeset viewer.
