Changeset 29495 for trunk/ippScripts/scripts/magic_process.pl
- Timestamp:
- Oct 20, 2010, 11:53:36 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_process.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_process.pl
r29493 r29495 325 325 } 326 326 327 ### Input result into database 328 { 329 my $command = "$magictool -addresult"; 330 $command .= " -magic_id $magic_id"; 331 $command .= " -node $node"; 332 $command .= " -path_base $outroot"; 333 $command .= " -dbname $dbname" if defined $dbname; 334 335 # Add the processed file to the database 336 unless ($no_update) { 337 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 338 run(command => $command, verbose => $verbose); 339 unless ($success) { 340 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 341 &my_die("Unable to perform magictool -addresult: $error_code", $magic_id, $node, $error_code); 342 } 343 } else { 344 print "Skipping command: $command\n"; 345 } 346 } 327 347 328 348 if ($node eq "root") { 349 # XXXX: Since we just added the result above, all of these my_dies are going to fail 350 # with a duplicate row error. 351 # see more comments below 329 352 my $streaks_file = "$outroot.streaks"; 330 353 my $resolved = $ipprc->file_resolve($streaks_file); … … 389 412 } 390 413 391 ### Input result into database392 # XXXX: if this succeeds but addmask fails the magicRun is in a goofy state XXXX393 {394 my $command = "$magictool -addresult";395 $command .= " -magic_id $magic_id";396 $command .= " -node $node";397 $command .= " -path_base $outroot";398 $command .= " -dbname $dbname" if defined $dbname;399 400 # Add the processed file to the database401 unless ($no_update) {402 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =403 run(command => $command, verbose => $verbose);404 unless ($success) {405 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);406 &my_die("Unable to perform magictool -addresult: $error_code", $magic_id, $node, $error_code);407 }408 } else {409 print "Skipping command: $command\n";410 }411 }412 413 414 414 { 415 415 my $command = "$magictool -addmask"; … … 425 425 unless ($success) { 426 426 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 427 # This isn't going to work because our result was already entered. 427 # XXX: This my_die isn't going to work because the result for the root node was already 428 # added to the database up above. 429 # There is a magicMask has a fault column. Maybe we should 430 # use that and add a new revert mode that deletes the magicMask and the magicNodeResult 431 # for the root node. 428 432 &my_die("Unable to perform magictool -addmask: $error_code", $magic_id, $node, $error_code); 429 433 } … … 433 437 } 434 438 } 439 435 440 436 441 ### Pau.
Note:
See TracChangeset
for help on using the changeset viewer.
