Changeset 18232 for trunk/pstamp/scripts
- Timestamp:
- Jun 20, 2008, 9:34:35 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstamp_parser_run.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_parser_run.pl
r17893 r18232 5 5 ### 6 6 7 #XXX TODO: accept dbname save-temps and verbose as command line parameters8 7 #XXX see notes about error handling 9 8 … … 12 11 13 12 use Sys::Hostname; 14 15 my $verbose = 1; 13 use Getopt::Long qw( GetOptions ); 14 15 my $verbose; 16 my $dbname; 17 my $request_id; 18 19 GetOptions( 20 'verbose' => \$verbose, 21 'dbname=s' => \$dbname, 22 'req_id=s' => \$request_id, 23 ); 24 16 25 if ($verbose) { 17 26 my $host = hostname(); … … 20 29 } 21 30 22 if (@ARGV != 1) { 23 die "usage: $0 request_id\n"; 24 } 25 26 my $request_id = $ARGV[0]; 31 die "req_id is required" if !defined($request_id); 27 32 28 33 use IPC::Cmd 0.36 qw( can_run run ); … … 77 82 { 78 83 my $command = "$pstamptool -pendingreq -req_id $request_id"; 84 $command .= " -dbname $dbname" if $dbname; 79 85 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 80 86 run(command => $command, verbose => $verbose); … … 135 141 if ($ds_id) { 136 142 my $command = "$pstamptool -datastore -ds_id $ds_id"; 143 $command .= " -dbname $dbname" if $dbname; 137 144 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 138 145 run(command => $command, verbose => $verbose); … … 173 180 if ($request_type eq "PS1_PS_REQUEST") { 174 181 $parse_cmd = $pstampparse . " -mode queue_job -req_id $request_id -out_dir $outdir $uri"; 182 $parse_cmd .= " -dbname $dbname" if $dbname; 175 183 } elsif ($request_type eq "MOPS_DETECTABILITY_QUERY") { 176 184 $parse_cmd = $dqueryparse . " --mode queue_job --req_id $request_id --out_dir $outdir --uri $uri"; … … 195 203 } 196 204 } 197 # XXX make sure that a job got actually got queued. If not set the request result and set state to 205 206 # XXX make sure that a job got actually got queued. 207 # If not set the request result and set state to 198 208 # run so that the "request finisher" can build the results file. 199 209 … … 203 213 { 204 214 my $command = "$pstamptool -processedreq -req_id $request_id -state run"; 215 $command .= " -dbname $dbname" if $dbname; 205 216 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 206 217 run(command => $command, verbose => $verbose);
Note:
See TracChangeset
for help on using the changeset viewer.
