Changeset 25781 for trunk/ippScripts/scripts/ipp_cleanup.pl
- Timestamp:
- Oct 5, 2009, 5:11:19 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/ipp_cleanup.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_cleanup.pl
r25473 r25781 91 91 92 92 # if there are no chipProcessedImfiles (@$stdout_buf == 0), the reset the state to 'new' 93 # XXX Why? This could just mean there's nothing to cleanup, or that we're trying to rerun an errored run. 93 94 if (@$stdout_buf == 0) { 94 my $command = "$chiptool -chip_id $stage_id -updaterun -set_state new";95 my $command = "$chiptool -chip_id $stage_id -updaterun -set_state $error_state"; 95 96 $command .= " -dbname $dbname" if defined $dbname; 96 97 … … 123 124 my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id); 124 125 125 # if (!$config_file or ! -e $config_file) {126 126 unless ($ipprc->file_exists($config_file)) { 127 127 print STDERR "skipping cleanup for chipRun $stage_id $class_id " … … 199 199 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code); 200 200 } 201 202 # We want to flag the run as well, to avoid attempting to reprocess the same data over and over again. 203 $command = "$chiptool -chip_id $stage_id -updaterun -set_state $error_state"; 204 $command .= " -dbname $dbname" if defined $dbname; 205 206 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 207 run(command => $command, verbose => $verbose); 208 unless ($success) { 209 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 210 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code); 211 212 } 201 213 } 202 214 } … … 314 326 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 315 327 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 328 } 329 330 if (@$stdout_buf == 0) { 331 # No skycells were found for some reason. 332 # Not technically an "error," but a "you told me to do X, and I can't. Please fix this yourself." 333 my $command = "$warptool -updaterun -warp_id $stage_id -set_state $error_state"; 334 $command .= " -dbname $dbname" if defined $dbname; 335 336 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 337 run(command => $command, verbose => $verbose); 338 unless ($success) { 339 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 340 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 341 } 342 343 exit(0); 316 344 } 317 345 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or … … 389 417 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 390 418 } 419 420 391 421 } else { 392 422 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state"; … … 399 429 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 400 430 } 401 exit $PS_EXIT_UNKNOWN_ERROR; 431 432 # exit $PS_EXIT_UNKNOWN_ERROR; 402 433 } 403 434 } … … 422 453 &my_die("Unable to perform stacktool: $error_code", "stack", $stage_id, $error_code); 423 454 } 455 456 if (@$stdout_buf == 0) { 457 # No skycells were found for some reason. 458 # Not technically an "error," but a "you told me to do X, and I can't. Please fix this yourself." 459 my $command = "$stacktool -updaterun -stack_id $stage_id -set_state $error_state"; 460 $command .= " -dbname $dbname" if defined $dbname; 461 462 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 463 run(command => $command, verbose => $verbose); 464 unless ($success) { 465 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 466 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 467 } 468 469 exit(0); 470 } 471 424 472 my $metadata = $mdcParser->parse(join "", @{ $stdout_buf }) or 425 473 &my_die("Unable to parse metadata config doc", "stack", $stage_id, $PS_EXIT_PROG_ERROR); … … 523 571 &my_die("Unable to perform difftool: $error_code", "diff", $stage_id, $error_code); 524 572 } 573 574 if (@$stdout_buf == 0) { 575 # No skycells were found for some reason. 576 # Not technically an "error," but a "you told me to do X, and I can't. Please fix this yourself." 577 my $command = "$difftool -updaterun -diff_id $stage_id -set_state $error_state"; 578 $command .= " -dbname $dbname" if defined $dbname; 579 580 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 581 run(command => $command, verbose => $verbose); 582 unless ($success) { 583 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 584 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 585 } 586 587 exit(0); 588 } 589 525 590 my $metadata = $mdcParser->parse(join "", @{ $stdout_buf }) or 526 591 &my_die("Unable to parse metadata config doc", "diff", $stage_id, $PS_EXIT_PROG_ERROR); … … 646 711 # if there are no fakeProcessedImfiles (@$stdout_buf == 0), the reset the state to 'new' 647 712 if (@$stdout_buf == 0) { 648 my $command = "$faketool -fake_id $stage_id -updaterun -set_state new";713 my $command = "$faketool -fake_id $stage_id -updaterun -set_state $error_state"; 649 714 $command .= " -dbname $dbname" if defined $dbname; 650 715
Note:
See TracChangeset
for help on using the changeset viewer.
