Changeset 35364
- Timestamp:
- Apr 4, 2013, 1:09:34 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm (modified) (2 diffs)
-
pstamp/scripts/pstamp_finish.pl (modified) (3 diffs)
-
pstamp/scripts/pstamp_parser_run.pl (modified) (3 diffs)
-
pstamp/scripts/pstampparse.pl (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
r34448 r35364 167 167 my $fields_output; 168 168 { 169 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION USERNAMEEMAIL";169 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION EMAIL"; 170 170 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 171 171 run(command => $command, verbose => $verbose); … … 187 187 if ($extver > 1) { 188 188 $header{ACTION} = $action; 189 $header{USER} = $username;190 189 $header{EMAIL} = $email; 191 190 } else { 192 191 $header{ACTION} = $action = "PROCESS"; 193 $header{USERNAME} = 'null';194 192 $header{EMAIL} = 'null'; 195 193 } 196 194 197 if ($action eq "LIST") { 198 return (\%header, undef); 199 } elsif ($action ne "PROCESS") { 200 die "unexpected request ACTION found: $action in $request_file_name"; 195 if ($action ne "PROCESS" and $action ne 'PREVIEW') { 196 die "\nunexpected request ACTION found: $action in $request_file_name"; 201 197 } 202 198 -
trunk/pstamp/scripts/pstamp_finish.pl
r34447 r35364 107 107 my ($header, $rows) = read_request_file($req_file); 108 108 109 my $action = $header->{ACTION}; 110 111 if (!$header or (($action eq 'PROCESS') and !$rows)) { 109 if (!$header or !$rows) { 112 110 # Since a request got queued, the request file must have been readable at some point 113 111 my_die("failed to read request file $req_file", $req_id, $PS_EXIT_CONFIG_ERROR); … … 128 126 129 127 my $request_fault = 0; 130 if ($action eq 'PROCESS'){128 { 131 129 # The results table definition file 132 130 my ($tdf, $table_def_name) = tempfile ("$outdir/tabledef.XXXX", UNLINK => !$save_temps); … … 273 271 } 274 272 } 275 } elsif ($action ne 'LIST') {276 my_die("Unexpected action $action found", $req_id, $PS_EXIT_PROG_ERROR);277 } else {278 # pstampparse did all of the work279 273 } 280 274 -
trunk/pstamp/scripts/pstamp_parser_run.pl
r34232 r35364 158 158 my $request_fault = $PSTAMP_INVALID_REQUEST; 159 159 160 my $action = 'PROCESS'; 161 160 162 if (-r $uri) { 161 163 # run the appropriate parse command to parse the queue the jobs for this request 162 164 # first check the extension header to find the EXTNAME 163 $request_type = find_request_type($uri );165 $request_type = find_request_type($uri, \$action); 164 166 165 167 if ($request_type) { … … 240 242 241 243 if ($success) { 242 $newState = 'run'; 244 if ($action eq 'PROCESS') { 245 $newState = 'run'; 246 } elsif ($action eq 'PREVIEW') { 247 $newState = 'parsed'; 248 } else { 249 print STDERR "WARNING Ignoring unexpected value for ACTION found in request header: $action\n"; 250 } 243 251 } else { 244 252 $fault = $error_code >> 8; … … 275 283 # find the EXTNAME in the input fits table 276 284 my $file_name = shift; 277 my $out = `echo $file_name | fields -x 0 EXTNAME`; 285 my $r_action = shift; 286 287 my $out = `echo $file_name | fields -x 0 EXTNAME ACTION`; 278 288 279 289 if ($out) { 280 290 # output from fields is filename value 281 my ($dummy, $extname) = split " ", $out; 291 my ($dummy, $extname, $action) = split " ", $out; 292 293 $$r_action = $action if ($action); 282 294 283 295 return $extname; -
trunk/pstamp/scripts/pstampparse.pl
r35363 r35364 411 411 412 412 if ($action eq 'LIST') { 413 # LIST is not allowed by caller. Can't get here. 413 414 return list_targets($rowList); 414 415 } … … 516 517 $row->{need_magic} = $need_magic; 517 518 518 $num_jobs += queueJobs($ mode, \@rowList, $imageList);519 $num_jobs += queueJobs($action, \@rowList, $imageList); 519 520 520 521 # if a row slipped through with no jobs add a faulted one … … 538 539 my $image = shift; 539 540 my $need_magic = shift; 540 my $ mode= shift;541 my $action = shift; 541 542 542 543 my $rownum = $row->{ROWNUM}; … … 621 622 write_params($output_base, $image); 622 623 623 my $newState = "run";624 my $newState = $action eq 'PROCESS' ? "run" : "parsed"; 624 625 my $fault = 0; 625 626 my $dep_id; 626 627 627 queueUpdatesIfNeeded($ stage, $image, $option_mask, \$newState, \$fault, \$dep_id);628 queueUpdatesIfNeeded($action, $stage, $image, $option_mask, \$newState, \$fault, \$dep_id); 628 629 629 630 my $command = "$pstamptool -addjob -req_id $req_id -job_type $row->{JOB_TYPE}" … … 654 655 sub queueJobs 655 656 { 656 my $ mode= shift;657 my $action = shift; 657 658 my $rowList = shift; 658 659 my $imageList = shift; … … 674 675 my_die( "error: unexpected number of rows for get_image request: $n", $PS_EXIT_PROG_ERROR) if $n != 1; 675 676 676 $num_jobs = queueGetImageJobs($firstRow, $imageList, $stage, $need_magic, $ mode);677 $num_jobs = queueGetImageJobs($firstRow, $imageList, $stage, $need_magic, $action); 677 678 678 679 } else { … … 702 703 my $row = $rowList->[$i]; 703 704 704 $num_jobs += queueJobForImage($row, $stage, $image, $need_magic, $ mode);705 $num_jobs += queueJobForImage($row, $stage, $image, $need_magic, $action); 705 706 } 706 707 } … … 716 717 my $stage = shift; 717 718 my $need_magic = shift; 718 my $ mode= shift;719 my $action = shift; 719 720 720 721 my $num_jobs = 0; … … 763 764 write_params($output_base, $image); 764 765 765 my $newState = "run";766 my $newState = $action eq 'PROCESS' ? "run" : "parsed"; 766 767 my $fault = 0; 767 768 my $dep_id; 768 769 769 queueUpdatesIfNeeded($ stage, $image, $option_mask, \$newState, \$fault, \$dep_id);770 queueUpdatesIfNeeded($action, $stage, $image, $option_mask, \$newState, \$fault, \$dep_id); 770 771 771 772 $num_jobs++; … … 909 910 sub get_dependent 910 911 { 911 my ($ r_jobState, $r_fault, $r_dep_id, $imagedb, $state, $stage, $stage_id, $component, $need_magic) = @_;912 my ($action, $r_jobState, $r_fault, $r_dep_id, $imagedb, $state, $stage, $stage_id, $component, $need_magic) = @_; 912 913 913 914 # chipRun's can be in full state if destreaking is necessary … … 928 929 my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb -component $component -outdir $outdir"; 929 930 $command .= " -need_magic" if $need_magic; 931 $command .= ' -hold' if $action eq 'PREVIEW'; 930 932 931 933 # compute rlabel for the run. … … 977 979 978 980 sub queueUpdatesIfNeeded { 981 my $action = shift; 979 982 my $stage = shift; 980 983 my $image = shift; … … 1026 1029 # set up to queue an update run 1027 1030 my $require_magic = ($need_magic or $image->{magicked}); 1028 get_dependent( \$$r_newState, \$$r_fault, $r_dep_id, $image->{imagedb},1031 get_dependent($action, \$$r_newState, \$$r_fault, $r_dep_id, $image->{imagedb}, 1029 1032 $run_state, $stage, $image->{stage_id}, $image->{component}, $require_magic ); 1030 1033 }
Note:
See TracChangeset
for help on using the changeset viewer.
