Changeset 27874 for trunk/pstamp
- Timestamp:
- May 6, 2010, 1:55:20 PM (16 years ago)
- Location:
- trunk/pstamp/scripts
- Files:
-
- 1 added
- 11 edited
-
Makefile.am (modified) (1 diff)
-
dquery_finish.pl (modified) (8 diffs)
-
dqueryparse.pl (modified) (12 diffs)
-
pstamp_checkdependent.pl (modified) (2 diffs)
-
pstamp_cleanup.pl (added)
-
pstamp_dorequest.pl (modified) (1 diff)
-
pstamp_finish.pl (modified) (12 diffs)
-
pstamp_get_image_job.pl (modified) (3 diffs)
-
pstamp_job_run.pl (modified) (2 diffs)
-
pstamp_parser_run.pl (modified) (10 diffs)
-
pstampparse.pl (modified) (7 diffs)
-
request_finish.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/Makefile.am
r27859 r27874 3 3 4 4 install_files = \ 5 pstamp_cleanup.pl \ 5 6 pstamp_finish.pl \ 6 7 pstamp_insert_request.pl \ -
trunk/pstamp/scripts/dquery_finish.pl
r27859 r27874 20 20 use PS::IPP::Config qw( :standard ); 21 21 22 my ( $req_id, $req_name, $req_file, $product, $out _dir, $dbname, $dbserver, $verbose, $save_temps );22 my ( $req_id, $req_name, $req_file, $product, $outdir, $dbname, $dbserver, $verbose, $save_temps ); 23 23 24 24 GetOptions( … … 27 27 'req_file=s' => \$req_file, 28 28 'product=s' => \$product, 29 'out _dir=s' => \$out_dir,29 'outdir=s' => \$outdir, 30 30 'dbname=s' => \$dbname, 31 31 'dbserver=s' => \$dbserver, … … 41 41 $err .= "--req_name is required\n" if !$req_name; 42 42 $err .= "--product is required\n" if !$product; 43 $err .= "--out _dir is required\n" if !$out_dir;43 $err .= "--outdir is required\n" if !$outdir; 44 44 45 45 die "$err" if $err; … … 76 76 die "product directory does not exist $prod_dir"; 77 77 } 78 my $out _dir = "$prod_dir/$req_name";78 my $outdir = "$prod_dir/$req_name"; 79 79 } 80 if (! -e $out _dir ) {80 if (! -e $outdir ) { 81 81 # something must have gone wrong at the parse stage 82 print STDERR "output fileset directory $out _dir does not exist\n" if $verbose;83 if (! mkdir $out _dir ) {82 print STDERR "output fileset directory $outdir does not exist\n" if $verbose; 83 if (! mkdir $outdir ) { 84 84 stop_request($req_id, $PS_EXIT_SYS_ERROR, $verbose); 85 die "cannot create output directory $out _dir";85 die "cannot create output directory $outdir"; 86 86 } 87 } elsif (! -d $out _dir) {87 } elsif (! -d $outdir) { 88 88 stop_request($req_id, $PS_EXIT_SYS_ERROR, $verbose); 89 die "output fileset directory $out _dir exists but is not a directory";89 die "output fileset directory $outdir exists but is not a directory"; 90 90 } 91 91 … … 118 118 119 119 # XXX: have the jobs produce the reglist as with postage stamp requests 120 my ($REGLIST, $reg_list) = tempfile("$out _dir/reqlist.XXXX", UNLINK => !$save_temps);120 my ($REGLIST, $reg_list) = tempfile("$outdir/reqlist.XXXX", UNLINK => !$save_temps); 121 121 122 122 foreach my $job (@jobs) { 123 123 my $job_id = $job->{job_id}; 124 124 my $response_file = "response${job_id}.fits"; 125 my $response_path = "$out _dir/$response_file";125 my $response_path = "$outdir/$response_file"; 126 126 127 127 if (-e $response_path) { … … 131 131 # do the same if we have an error file. Should the parse data be uploaded as well? 132 132 my $err_file = "parse_error.txt"; 133 if (-e "$out _dir/$err_file") {133 if (-e "$outdir/$err_file") { 134 134 print $REGLIST "$err_file|||text|\n"; 135 135 } … … 143 143 if (-s $reg_list) { 144 144 my $command = "$dsreg --add $req_name --product $product --list $reg_list"; 145 $command .= " --copy --datapath $out _dir";145 $command .= " --copy --datapath $outdir"; 146 146 $command .= " --type MOPS_DETECTABILITY_RESPONSE"; 147 147 $command .= " --ps0 $req_id"; … … 166 166 my $verbose = shift; 167 167 168 my $command = "$pstamptool -updatereq -req_id $req_id -s tate stop";169 $command .= " - fault $fault" if $fault;168 my $command = "$pstamptool -updatereq -req_id $req_id -set_state stop"; 169 $command .= " -set_fault $fault" if $fault; 170 170 $command .= " -dbname $dbname" if $dbname; 171 171 $command .= " -dbserver $dbserver" if $dbserver; -
trunk/pstamp/scripts/dqueryparse.pl
r27859 r27874 26 26 27 27 my ($no_update, $imagedb, $label); 28 my ($req_file, $req_id, $out _dir, $product, $mode, $dbname, $dbserver, $verbose, $save_temps);28 my ($req_file, $req_id, $outdir, $product, $mode, $dbname, $dbserver, $verbose, $save_temps); 29 29 my ($job_id,$rownum); # stuff from the post-update world 30 30 # … … 37 37 'job_id=s' => \$job_id, 38 38 'rownum=s' => \$rownum, 39 'out _dir=s' => \$out_dir,39 'outdir=s' => \$outdir, 40 40 'label=s' => \$label, 41 41 'product=s' => \$product, … … 52 52 if ($mode ne "list_uri") { 53 53 die "req_id is required" if !$req_id; 54 die "out _dir is required" if !$out_dir;54 die "outdir is required" if !$outdir; 55 55 die "product is required" if !$product; 56 56 } … … 80 80 # Unless we're running as a job, write the parse arguments in case we need to rerun this parsing. 81 81 if (!$job_id) { 82 my $argslist = "$out _dir/parse.args";82 my $argslist = "$outdir/parse.args"; 83 83 open ARGSLIST, ">$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR); 84 print ARGSLIST "--label $label --mode $mode --req_id $req_id --product $product --out _dir $out_dir --file $req_file\n";84 print ARGSLIST "--label $label --mode $mode --req_id $req_id --product $product --outdir $outdir --file $req_file\n"; 85 85 close ARGSLIST; 86 86 } … … 105 105 106 106 # Set up the workdir for this query. 107 if (! -e $out _dir ) {108 mkdir $out _dir or my_die("cannot create output directory $out_dir", $PS_EXIT_PROG_ERROR);109 } elsif (! -d $out _dir ) {110 my_die ("output fileset directory $out _dir exists but is not a directory", $PS_EXIT_PROG_ERROR);107 if (! -e $outdir ) { 108 mkdir $outdir or my_die("cannot create output directory $outdir", $PS_EXIT_PROG_ERROR); 109 } elsif (! -d $outdir ) { 110 my_die ("output fileset directory $outdir exists but is not a directory", $PS_EXIT_PROG_ERROR); 111 111 } 112 112 113 113 114 114 # Pass along the request file to the response generator. 115 my $response_file = "$out _dir/${req_name}.dresponse.${req_id}.fits";115 my $response_file = "$outdir/${req_name}.dresponse.${req_id}.fits"; 116 116 my $fault; 117 117 my $data_to_update = ''; 118 118 { 119 my $command = "$detectresponse --input $req_file --output $response_file --workdir $out _dir";119 my $command = "$detectresponse --input $req_file --output $response_file --workdir $outdir"; 120 120 $command .= " --save-temps" if $save_temps; 121 121 $command .= " --verbose" if $verbose; … … 137 137 # for the completed work, and move the response to a standardized name. 138 138 if ($fault == 0) { 139 my $command = "$pstamptool -addjob -req_id $req_id -outputBase $out _dir";139 my $command = "$pstamptool -addjob -req_id $req_id -outputBase $outdir"; 140 140 $command .= " -job_type detect_query -state stop -fault 0"; 141 141 $command .= " -rownum 1"; … … 147 147 chomp $job_id; 148 148 if ($job_id && -e $response_file) { 149 rename $response_file, "$out _dir/response${job_id}.fits";149 rename $response_file, "$outdir/response${job_id}.fits"; 150 150 } 151 151 $result = 0; … … 158 158 # Failed to run correctly, which means that we need to queue a job and flag data for updating. 159 159 # Get the dependency id for the data we're requesting be updated. 160 my $dep_id = queue_update_run($req_id,$job_id,$out _dir,$label,$data_to_update);160 my $dep_id = queue_update_run($req_id,$job_id,$outdir,$label,$data_to_update); 161 161 162 162 # Link this request to a job and link that job to any dependency 163 my $command = "$pstamptool -addjob -req_id $req_id -outputBase $out _dir";163 my $command = "$pstamptool -addjob -req_id $req_id -outputBase $outdir"; 164 164 $command .= " -job_type detect_query -state run -fault 0"; 165 165 $command .= " -rownum 1"; … … 174 174 if ($job_id && -e $response_file) { 175 175 # We shouldn't have a response file at this stage. 176 rename $response_file, "$out _dir/response${job_id}.fits";176 rename $response_file, "$outdir/response${job_id}.fits"; 177 177 } 178 178 $result = 0; … … 186 186 # which will notice that we've inserted the stopped job and decide we're finished. Easy enough. 187 187 { 188 my $command = "$pstamptool -updatereq -req_id $req_id - name $req_name -outProduct $product";189 $command .= " - fault $result" if $result;188 my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name -set_outProduct $product"; 189 $command .= " -set_fault $result" if $result; 190 190 191 191 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 201 201 # If we have to queue an update run, do so and create a new dependent 202 202 sub queue_update_run { 203 my ($req_id, $job_id, $out _dir, $label, $data_to_update) = @_;203 my ($req_id, $job_id, $outdir, $label, $data_to_update) = @_; 204 204 205 205 my ($state, $stage, $stage_id, $component, $need_magic, $imagedb) = split /\s+/, $data_to_update; … … 211 211 my $dep_id; 212 212 my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb -component $component "; 213 $command .= " -outdir $out _dir";213 $command .= " -outdir $outdir"; 214 214 $command .= " -need_magic" if $need_magic; 215 215 -
trunk/pstamp/scripts/pstamp_checkdependent.pl
r27853 r27874 575 575 my ($state, $stage, $stage_id, $job_fault) = @_; 576 576 577 my $command = "$pstamptool -updatejob -s tate stop -fault $job_fault -dep_id $dep_id";577 my $command = "$pstamptool -updatejob -set_state stop -set_fault $job_fault -dep_id $dep_id"; 578 578 $command .= " -dbname $dbname" if $dbname; 579 579 $command .= " -dbserver $dbserver" if $dbserver; … … 642 642 carp $msg; 643 643 644 my $command = "$pstamptool -updatedependent - fault $fault -dep_id $dep_id";644 my $command = "$pstamptool -updatedependent -set_fault $fault -dep_id $dep_id"; 645 645 $command .= " -dbname $dbname" if $dbname; 646 646 $command .= " -dbserver $dbserver" if $dbserver; -
trunk/pstamp/scripts/pstamp_dorequest.pl
r19221 r27874 106 106 { 107 107 ## TODO: what about request status 108 my $command = "$pstamptool -updatereq -req_id $request_id -s tate stop";108 my $command = "$pstamptool -updatereq -req_id $request_id -set_state stop"; 109 109 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 110 110 run(command => $command, verbose => $verbosity); -
trunk/pstamp/scripts/pstamp_finish.pl
r27751 r27874 25 25 use PS::IPP::PStamp::Job qw( :standard ); 26 26 27 my ( $req_id, $req_name, $req_file, $out _dir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output);27 my ( $req_id, $req_name, $req_file, $outdir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output); 28 28 29 29 # the char to the right of the bar may be used as a single - alias for the longer name … … 34 34 'req_file=s' => \$req_file, 35 35 'product=s' => \$product, 36 'out _dir=s' => \$out_dir,36 'outdir=s' => \$outdir, 37 37 'dbname=s' => \$dbname, 38 38 'dbserver=s' => \$dbserver, … … 44 44 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 45 45 46 die "usage: --req_id id --req_name name --req_file file --product product --out _dir output_directory [--dbname dbname --verbose]\n"47 if !$req_id or !$req_name or !$req_file or !$product or !$out _dir;46 die "usage: --req_id id --req_name name --req_file file --product product --outdir output_directory [--dbname dbname --verbose]\n" 47 if !$req_id or !$req_name or !$req_file or !$product or !$outdir; 48 48 49 49 my $ipprc = PS::IPP::Config->new(); # IPP Configuration 50 50 if ($redirect_output) { 51 my $logDest = "$out _dir/psfinish.$req_id.log";51 my $logDest = "$outdir/psfinish.$req_id.log"; 52 52 $ipprc->redirect_output($logDest); 53 53 } … … 82 82 my $fileset = $req_name; 83 83 84 print STDERR "product: $product REQ_NAME: $req_name $out _dir\n" if $verbose;85 86 if (!-e $out _dir) {84 print STDERR "product: $product REQ_NAME: $req_name $outdir\n" if $verbose; 85 86 if (!-e $outdir) { 87 87 # something must have gone wrong parsing the request 88 print STDERR "output directory $out _dir does not exist\n";89 90 if (!mkdir $out _dir) {91 print STDERR "cannot create output directory $out _dir";88 print STDERR "output directory $outdir does not exist\n"; 89 90 if (!mkdir $outdir) { 91 print STDERR "cannot create output directory $outdir"; 92 92 stop_request_and_exit($req_id, $PS_EXIT_UNKNOWN_ERROR); 93 93 } 94 94 95 95 96 } elsif (! -d $out _dir ) {96 } elsif (! -d $outdir ) { 97 97 # XXX TODO: fault the request so we pstamp_finish doesn't keep trying to process the 98 98 # request 99 print STDERR "output directory $out _dir exists but is not a directory";99 print STDERR "output directory $outdir exists but is not a directory"; 100 100 stop_request_and_exit($req_id, $PS_EXIT_UNKNOWN_ERROR); 101 101 } … … 122 122 # the following is for a postage stamp request 123 123 124 my ($rlf, $reglist_name) = tempfile ("$out _dir/reglist.XXXX", UNLINK => !$save_temps);124 my ($rlf, $reglist_name) = tempfile ("$outdir/reglist.XXXX", UNLINK => !$save_temps); 125 125 print $rlf "results.fits|||table|\n"; 126 126 print $rlf "results.mdc|||text|\n"; 127 127 128 128 my $err_file = "parse_error.txt"; 129 if (-e "$out _dir/$err_file" ) {129 if (-e "$outdir/$err_file" ) { 130 130 print $rlf "$err_file|||text|\n"; 131 131 } 132 132 133 my ($tdf, $table_def_name) = tempfile ("$out _dir/tabledef.XXXX", UNLINK => !$save_temps);133 my ($tdf, $table_def_name) = tempfile ("$outdir/tabledef.XXXX", UNLINK => !$save_temps); 134 134 135 135 … … 208 208 209 209 if (($job_type eq "stamp") || ($job_type eq "get_image") || ($job_type eq "none")) { 210 my $jreglist = "$out _dir/reglist$job_id";210 my $jreglist = "$outdir/reglist$job_id"; 211 211 if (open JRL, "<$jreglist") {; 212 212 # process the reglist file to get the list of files produced by this job … … 225 225 # If not found check the PHU. If that doesn't work just set them to zero. 226 226 # XXX do this more cleanly 227 my (undef, $ra_deg, $dec_deg) = split " ", `echo $out _dir/$img_name | fields -x 0 RA_DEG DEC_DEG`;227 my (undef, $ra_deg, $dec_deg) = split " ", `echo $outdir/$img_name | fields -x 0 RA_DEG DEC_DEG`; 228 228 if (!defined $ra_deg) { 229 (undef, $ra_deg, $dec_deg) = split " ", `echo $out _dir/$img_name | fields RA_DEG DEC_DEG`;229 (undef, $ra_deg, $dec_deg) = split " ", `echo $outdir/$img_name | fields RA_DEG DEC_DEG`; 230 230 } 231 231 $ra_deg = 0.0 if (!$ra_deg); … … 258 258 # make the results file 259 259 { 260 my $command = "$pstamp_results --input $table_def_name --output $out _dir/results.fits";260 my $command = "$pstamp_results --input $table_def_name --output $outdir/results.fits"; 261 261 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 262 262 run(command => $command, verbose => $verbose); … … 266 266 } else { 267 267 # dump a textual representation 268 my $command = "$pstampdump $out _dir/results.fits > $out_dir/results.mdc";268 my $command = "$pstampdump $outdir/results.fits > $outdir/results.mdc"; 269 269 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 270 270 run(command => $command, verbose => $verbose); … … 278 278 # register the fileset 279 279 my $command = "$dsreg --list $reglist_name --add $fileset --product $product --type PSRESULTS"; 280 $command .= " --link --datapath $out_dir --ps0 $req_id"; 281 $command .= " --dbname $dbname" if $dbname; 280 $command .= " --link --datapath $outdir --ps0 $req_id"; 281 # XXX: let dsreg and config handle resolving dbname and dbserver 282 # $command .= " --dbname $dbname" if $dbname; 282 283 283 284 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 292 293 # set the request's state to stop 293 294 { 294 my $command = "$pstamptool -updatereq -req_id $req_id -s tate stop -fault $request_fault";295 my $command = "$pstamptool -updatereq -req_id $req_id -set_state stop -set_fault $request_fault"; 295 296 $command .= " -dbname $dbname" if $dbname; 296 297 $command .= " -dbserver $dbserver" if $dbserver; … … 308 309 my $fault = shift; 309 310 310 my $command = "$pstamptool -updatereq -req_id $req_id -s tate stop -fault $fault";311 my $command = "$pstamptool -updatereq -req_id $req_id -set_state stop -set_fault $fault"; 311 312 $command .= " -dbname $dbname" if $dbname; 312 313 $command .= " -dbserver $dbserver" if $dbserver; -
trunk/pstamp/scripts/pstamp_get_image_job.pl
r26215 r27874 87 87 } 88 88 89 my $out _dir = dirname($output_base);89 my $outdir = dirname($output_base); 90 90 my $prefix = basename($output_base) . "_"; 91 91 my $results_file = $output_base . ".bundle_results"; … … 102 102 my $command = "$dist_bundle --camera $camera --stage $stage --stage_id $stage_id"; 103 103 $command .= " --component $component"; 104 $command .= " --path_base $path_base --outdir $out _dir --results_file $results_file";104 $command .= " --path_base $path_base --outdir $outdir --results_file $results_file"; 105 105 $command .= " --prefix $prefix"; 106 106 $command .= " --magicked" if $magicked; … … 139 139 } 140 140 141 my $reglist = "$out _dir/reglist$job_id";141 my $reglist = "$outdir/reglist$job_id"; 142 142 if (! open(REGLIST, ">$reglist") ) { 143 143 my_die("failed to open registration list: $reglist", $PS_EXIT_UNKNOWN_ERROR); -
trunk/pstamp/scripts/pstamp_job_run.pl
r27859 r27874 198 198 # mark the job stopped in the database 199 199 { 200 my $command = "$pstamptool -updatejob -job_id $job_id -s tate stop";201 $command .= " - fault $jobStatus" if $jobStatus;200 my $command = "$pstamptool -updatejob -job_id $job_id -set_state stop"; 201 $command .= " -set_fault $jobStatus" if $jobStatus; 202 202 $command .= " -dbname $dbname" if $dbname; 203 203 $command .= " -dbserver $dbserver" if $dbserver; … … 343 343 my $command = "$pstamptool -updatejob"; 344 344 $command .= " -job_id $job_id"; 345 $command .= " - fault $exit_code";345 $command .= " -set_fault $exit_code"; 346 346 # XXX: fix pstamptool to not require -state when -fault with nonzero value is provided 347 $command .= " -s tate run";347 $command .= " -set_state run"; 348 348 $command .= " -dbname $dbname" if defined $dbname; 349 349 $command .= " -dbserver $dbserver" if defined $dbserver; -
trunk/pstamp/scripts/pstamp_parser_run.pl
r27859 r27874 28 28 my $redirect_output; 29 29 my $product; 30 my $outdir; 30 31 my $label; 31 32 my $verbose; … … 37 38 'uri=s' => \$uri, 38 39 'product=s' => \$product, 40 'outdir=s' => \$outdir, 39 41 'label=s' => \$label, 40 42 'redirect-output' => \$redirect_output, … … 81 83 } 82 84 83 # workdir is where all of the files generated for this request are placed 84 # NOTE: this location needs to be kept in sync with the web interface ( request.php ) 85 my $datestr = strftime "%Y%m%d", gmtime; 86 my $datedir = "$pstamp_workdir/$datestr"; 87 if (! -e $datedir ) { 88 mkdir $datedir or my_die( "failed to create working directory $datedir for request id $req_id", $req_id, 85 if (!$outdir or ($outdir eq "NULL")) { 86 # workdir is where all of the files generated for this request are placed 87 # NOTE: this location needs to be kept in sync with the web interface ( request.php ) 88 my $datestr = strftime "%Y%m%d", gmtime; 89 my $datedir = "$pstamp_workdir/$datestr"; 90 if (! -e $datedir ) { 91 mkdir $datedir or my_die( "failed to create working directory $datedir for request id $req_id", $req_id, 92 $PS_EXIT_CONFIG_ERROR); 93 } 94 95 $outdir = "$datedir/$req_id"; 96 } 97 98 if (! -e $outdir ) { 99 mkdir $outdir or my_die("failed to create working directory $outdir for request id $req_id", $req_id, 89 100 $PS_EXIT_CONFIG_ERROR); 90 101 } 91 92 my $workdir = "$datedir/$req_id"; 93 if (! -e $workdir ) { 94 mkdir $workdir or my_die("failed to create working directory $workdir for request id $req_id", $req_id, 95 $PS_EXIT_CONFIG_ERROR); 96 } 102 97 103 98 104 if ($redirect_output) { 99 my $logDest = "$ workdir/psparse.$req_id.log";105 my $logDest = "$outdir/psparse.$req_id.log"; 100 106 $ipprc->redirect_output($logDest); 101 107 } … … 108 114 109 115 my $fn = basename($uri); 110 my $new_uri = "$ workdir/$fn";116 my $new_uri = "$outdir/$fn"; 111 117 if ($uri =~ /^http:/) { 112 118 # if the uri is an http uri download the file … … 123 129 } 124 130 if (! copy $uri, $new_uri) { 125 my_die ("failed to copy request file $uri to workdir $ workdir", $req_id, $PS_EXIT_UNKNOWN_ERROR);131 my_die ("failed to copy request file $uri to workdir $outdir", $req_id, $PS_EXIT_UNKNOWN_ERROR); 126 132 } 127 133 } … … 173 179 # that they sent us a request file that we don't understand 174 180 175 my $command = "$pstamptool -updatereq -req_id $req_id -s tate run";176 $command .= " - reqType unknown";177 $command .= " - fault $PS_EXIT_DATA_ERROR";181 my $command = "$pstamptool -updatereq -req_id $req_id -set_state run"; 182 $command .= " -set_reqType unknown"; 183 $command .= " -set_fault $PS_EXIT_DATA_ERROR"; 178 184 $command .= " -dbname $dbname" if $dbname; 179 185 $command .= " -dbserver $dbserver" if $dbserver; … … 186 192 } 187 193 188 $parse_cmd .= " --mode queue_job --req_id $req_id --product $product --out _dir $workdir --file $uri";194 $parse_cmd .= " --mode queue_job --req_id $req_id --product $product --outdir $outdir --file $uri"; 189 195 $parse_cmd .= " --dbname $dbname" if $dbname; 190 196 $parse_cmd .= " --dbserver $dbserver" if $dbserver; … … 194 200 my $fault; 195 201 { 196 my $error_file_name = "$ workdir/parse_error.txt";202 my $error_file_name = "$outdir/parse_error.txt"; 197 203 # get rid of any error file from previous attempt to parse this request 198 204 unlink $error_file_name if (-e $error_file_name); … … 227 233 # 228 234 { 229 my $command = "$pstamptool -updatereq -req_id $req_id -state $newState"; 230 $command .= " -reqType $reqType" if $reqType; 231 $command .= " -uri $new_uri" if $new_uri; 232 $command .= " -fault $fault" if $fault; 235 my $command = "$pstamptool -updatereq -req_id $req_id -set_state $newState"; 236 $command .= " -set_outdir $outdir"; 237 $command .= " -set_reqType $reqType" if $reqType; 238 $command .= " -set_uri $new_uri" if $new_uri; 239 $command .= " -set_fault $fault" if $fault; 233 240 $command .= " -dbname $dbname" if $dbname; 234 241 $command .= " -dbserver $dbserver" if $dbserver; … … 269 276 carp($msg); 270 277 271 my $command = "$pstamptool -updatereq -req_id $req_id - fault $fault";278 my $command = "$pstamptool -updatereq -req_id $req_id -set_fault $fault"; 272 279 $command .= " -dbname $dbname" if $dbname; 273 280 $command .= " -dbserver $dbserver" if $dbserver; -
trunk/pstamp/scripts/pstampparse.pl
r27854 r27874 25 25 my $request_file_name; 26 26 my $mode = "list_uri"; 27 my $out _dir;27 my $outdir; 28 28 my $product; 29 29 my $label; … … 34 34 'file=s' => \$request_file_name, 35 35 'req_id=s' => \$req_id, 36 'out _dir=s' => \$out_dir,36 'outdir=s' => \$outdir, 37 37 'product=s' => \$product, 38 38 'label=s' => \$label, … … 50 50 if ($mode ne "list_uri") { 51 51 die "req_id is required" if !$req_id; 52 die "out _dir is required" if !$out_dir;52 die "outdir is required" if !$outdir; 53 53 die "product is required" if !$product; 54 54 } … … 129 129 # update the database with the request name. This will be used as the 130 130 # the output data store's product name 131 my $command = "$pstamptool -updatereq -req_id $req_id - name $req_name";132 $command .= " - outProduct $product";131 my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name"; 132 $command .= " -set_outProduct $product"; 133 133 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 134 134 run(command => $command, verbose => $verbose); … … 522 522 $base =~ s/.fits$//; 523 523 524 my $output_base = "$out _dir/${rownum}_${job_num}_${base}";524 my $output_base = "$outdir/${rownum}_${job_num}_${base}"; 525 525 my $argslist = "${output_base}.args"; 526 526 … … 712 712 my $exp_id = $image->{exp_id}; 713 713 714 my $output_base = "$out _dir/${rownum}_${job_num}";714 my $output_base = "$outdir/${rownum}_${job_num}"; 715 715 716 716 write_params($output_base, $image); … … 894 894 895 895 my $dep_id; 896 my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb -component $component -outdir $out _dir";896 my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb -component $component -outdir $outdir"; 897 897 $command .= " -need_magic" if $need_magic; 898 898 -
trunk/pstamp/scripts/request_finish.pl
r24831 r27874 21 21 use PS::IPP::Config qw( :standard ); 22 22 23 my ( $req_id, $req_name, $req_file, $req_type, $out _dir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output );23 my ( $req_id, $req_name, $req_file, $req_type, $outdir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output ); 24 24 25 25 GetOptions( … … 28 28 'req_file=s' => \$req_file, 29 29 'req_type=s' => \$req_type, 30 'out _dir=s' => \$out_dir,30 'outdir=s' => \$outdir, 31 31 'product=s' => \$product, 32 32 'dbname=s' => \$dbname, … … 46 46 $err .= "--req_name is required\n" if !$req_name; 47 47 $err .= "--product is required\n" if !$product; 48 # $err .= "--out _dir is required\n" if !$out_dir;48 # $err .= "--outdir is required\n" if !$outdir; 49 49 50 50 die "$err" if $err; 51 51 52 52 53 if (!$out _dir) {54 $out _dir = dirname($req_file);53 if (!$outdir) { 54 $outdir = dirname($req_file); 55 55 } 56 56 57 57 if ($redirect_output) { 58 my $logDest = "$out _dir/reqfinish.$req_id.log";58 my $logDest = "$outdir/reqfinish.$req_id.log"; 59 59 my $ipprc = PS::IPP::Config->new(); 60 60 $ipprc->redirect_output($logDest); … … 79 79 } 80 80 if ($finish_cmd) { 81 my $command = $finish_cmd . " --req_id $req_id --req_name $req_name --req_file $req_file --product $product --out _dir $out_dir";81 my $command = $finish_cmd . " --req_id $req_id --req_name $req_name --req_file $req_file --product $product --outdir $outdir"; 82 82 $command .= " --dbname $dbname" if $dbname; 83 83 $command .= " --dbserver $dbserver" if $dbserver;
Note:
See TracChangeset
for help on using the changeset viewer.
