Changeset 33380
- Timestamp:
- Feb 28, 2012, 1:43:18 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/dqueryparse.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/dqueryparse.pl
r33324 r33380 17 17 use Pod::Usage qw( pod2usage ); 18 18 use File::Temp qw( tempfile tempdir); 19 use POSIX; # for strftime 19 20 20 21 use PS::IPP::PStamp::RequestFile qw( :standard ); … … 98 99 my_die("$request_file is version $extver expecting 1 or 2", $PS_EXIT_PROG_ERROR) 99 100 if ($extver ne 1) and ($extver ne 2); 101 102 if ($req_id) { 103 my $command = "$pstamptool -listreq -name $req_name -not_req_id $req_id"; 104 # set verbose to false so that error message about request not found doesn't appear in parse_error.txt 105 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 106 run(command => $command, verbose => 0); 107 if ($success) { 108 # -listreq succeeded duplicate request name 109 print STDERR "QUERY_ID $req_name has already been used\n"; 110 $command = "$pstamptool -addjob -job_type none -rownum 0 -state stop -fault $PSTAMP_DUP_REQUEST -req_id $req_id"; 111 unless ($no_update) { 112 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 113 run(command => $command, verbose => $verbose); 114 if (!$success) { 115 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR); 116 } 117 } else { 118 print STDERR "skipping $command\n"; 119 } 120 121 my $datestr = strftime "%Y%m%d%H%M%S.$req_id", gmtime; 122 $req_name = "ERROR.$datestr"; 123 } 124 $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name -set_outProduct $product"; 125 unless ($no_update) { 126 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 127 run(command => $command, verbose => $verbose); 128 unless ($success) { 129 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR); 130 } 131 } else { 132 print STDERR "skipping $command\n"; 133 } 134 exit (0); 135 } 136 100 137 101 138 … … 357 394 my $component = $query{$fpa_id}{COMPONENT_ID}[$i]; 358 395 print "Need to UPDATE $stage $stage_id $component from $data_state\n"; 359 #### my ($req_id, $outdir, $label, $state, $stage, $stage_id, $component, $need_magic, $imagedb) = @_;360 396 $dep_id = queue_update_run($req_id, $outdir, $label, $data_state, $stage, $stage_id, $component, 0, $imagedb); 361 397 } … … 413 449 } 414 450 415 # XXX: flesh this out once we have a request without duplicate ROWNUMS416 451 foreach my $rownum (keys %faulted_rows ) { 452 my $outputBase = "$outdir/$job_num" . "_"; 417 453 my $fault = $faulted_rows{$rownum}; 418 454 $fault = $PSTAMP_NO_IMAGE_MATCH if ($fault eq 'no_fault'); 419 455 print STDERR "insert faulted job for $rownum: $fault\n"; 456 my $command = "$pstamptool -addjob -req_id $req_id -outputBase $outputBase -job_type detect_query -state stop -rownum $rownum -fault $fault"; 457 unless ($no_update) { 458 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 459 run(command => $command, verbose => $verbose); 460 if ($success) { 461 my $job_id = join "", @$stdout_buf; 462 print " Queued job: $job_id\n"; 463 } else { 464 my $exit_status = $error_code >> 8; 465 $exit_status = $PS_EXIT_UNKNOWN_ERROR unless $exit_status; 466 my_die("Unable to perform $command error code: $error_code", $exit_status); 467 } 468 } else { 469 print STDERR "skipping $command\n"; 470 } 471 $job_num++; 420 472 } 421 473
Note:
See TracChangeset
for help on using the changeset viewer.
