IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27874 for trunk/pstamp


Ignore:
Timestamp:
May 6, 2010, 1:55:20 PM (16 years ago)
Author:
bills
Message:

Various changes to the postage stamp server and associated tables.
Implemented cleanup. Added pstampRequest.outdir changed spelling of out_dir
to outdir. various other cleanups

Location:
trunk/pstamp/scripts
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/Makefile.am

    r27859 r27874  
    33
    44install_files = \
     5        pstamp_cleanup.pl \
    56        pstamp_finish.pl \
    67        pstamp_insert_request.pl \
  • trunk/pstamp/scripts/dquery_finish.pl

    r27859 r27874  
    2020use PS::IPP::Config qw( :standard );
    2121
    22 my ( $req_id, $req_name, $req_file, $product, $out_dir, $dbname, $dbserver, $verbose, $save_temps );
     22my ( $req_id, $req_name, $req_file, $product, $outdir, $dbname, $dbserver, $verbose, $save_temps );
    2323
    2424GetOptions(
     
    2727           'req_file=s' => \$req_file,
    2828           'product=s'  => \$product,
    29            'out_dir=s'  => \$out_dir,
     29           'outdir=s'   => \$outdir,
    3030           'dbname=s'   => \$dbname,
    3131           'dbserver=s' => \$dbserver,
     
    4141$err .= "--req_name is required\n" if !$req_name;
    4242$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;
    4444
    4545die "$err" if $err;
     
    7676    die "product directory does not exist $prod_dir";
    7777}
    78 my $out_dir = "$prod_dir/$req_name";
     78my $outdir = "$prod_dir/$req_name";
    7979}
    80 if (! -e $out_dir ) {
     80if (! -e $outdir ) {
    8181    # 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 ) {
    8484        stop_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);
    85         die "cannot create output directory $out_dir";
     85        die "cannot create output directory $outdir";
    8686    }
    87 } elsif (! -d $out_dir) {
     87} elsif (! -d $outdir) {
    8888    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";
    9090}
    9191
     
    118118
    119119# 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);
     120my ($REGLIST, $reg_list) = tempfile("$outdir/reqlist.XXXX", UNLINK => !$save_temps);
    121121
    122122foreach my $job (@jobs) {
    123123    my $job_id = $job->{job_id};
    124124    my $response_file = "response${job_id}.fits";
    125     my $response_path = "$out_dir/$response_file";
     125    my $response_path = "$outdir/$response_file";
    126126
    127127    if (-e $response_path) {
     
    131131        # do the same if we have an error file.  Should the parse data be uploaded as well?
    132132        my $err_file = "parse_error.txt";
    133         if (-e "$out_dir/$err_file") {
     133        if (-e "$outdir/$err_file") {
    134134            print $REGLIST "$err_file|||text|\n";
    135135        }
     
    143143if (-s $reg_list) {
    144144    my $command = "$dsreg --add $req_name --product $product --list $reg_list";
    145     $command .= " --copy --datapath $out_dir";
     145    $command .= " --copy --datapath $outdir";
    146146    $command .= " --type MOPS_DETECTABILITY_RESPONSE";
    147147    $command .= " --ps0 $req_id";
     
    166166    my $verbose = shift;
    167167   
    168     my $command = "$pstamptool -updatereq -req_id $req_id -state 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;
    170170    $command   .= " -dbname $dbname" if $dbname;
    171171    $command   .= " -dbserver $dbserver" if $dbserver;
  • trunk/pstamp/scripts/dqueryparse.pl

    r27859 r27874  
    2626
    2727my ($no_update, $imagedb, $label);
    28 my ($req_file, $req_id, $out_dir, $product, $mode, $dbname, $dbserver, $verbose, $save_temps);
     28my ($req_file, $req_id, $outdir, $product, $mode, $dbname, $dbserver, $verbose, $save_temps);
    2929my ($job_id,$rownum); # stuff from the post-update world
    3030#
     
    3737        'job_id=s'        =>      \$job_id,
    3838        'rownum=s'        =>      \$rownum,
    39         'out_dir=s'       =>      \$out_dir,
     39        'outdir=s'       =>      \$outdir,
    4040        'label=s'         =>      \$label,
    4141        'product=s'       =>      \$product,
     
    5252if ($mode ne "list_uri") {
    5353    die "req_id is required" if !$req_id;
    54     die "out_dir is required" if !$out_dir;
     54    die "outdir is required" if !$outdir;
    5555    die "product is required" if !$product;
    5656}
     
    8080# Unless we're running as a job, write the parse arguments in case we need to rerun this parsing.
    8181if (!$job_id) {
    82     my $argslist = "$out_dir/parse.args";
     82    my $argslist = "$outdir/parse.args";
    8383    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";
    8585    close ARGSLIST;
    8686}
     
    105105
    106106# 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);
     107if (! -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);
    111111}
    112112
    113113
    114114# Pass along the request file to the response generator.
    115 my $response_file = "$out_dir/${req_name}.dresponse.${req_id}.fits";
     115my $response_file = "$outdir/${req_name}.dresponse.${req_id}.fits";
    116116my $fault;
    117117my $data_to_update = '';
    118118{
    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";
    120120    $command .= " --save-temps" if $save_temps;
    121121    $command .= " --verbose" if $verbose;
     
    137137# for the completed work, and move the response to a standardized name.
    138138if ($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";
    140140    $command .= " -job_type detect_query -state stop -fault 0";
    141141    $command .= " -rownum 1";
     
    147147        chomp $job_id;
    148148        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";
    150150        }
    151151        $result = 0;
     
    158158    # Failed to run correctly, which means that we need to queue a job and flag data for updating.
    159159    # 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);
    161161
    162162    # 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";
    164164    $command .= " -job_type detect_query -state run -fault 0";
    165165    $command .= " -rownum 1";
     
    174174        if ($job_id && -e $response_file) {
    175175            # 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";
    177177        }
    178178        $result = 0;
     
    186186# which will notice that we've inserted the stopped job and decide we're finished. Easy enough.
    187187{
    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;
    190190
    191191    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    201201# If we have to queue an update run, do so and create a new dependent
    202202sub 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) = @_;
    204204
    205205    my ($state, $stage, $stage_id, $component, $need_magic, $imagedb) = split /\s+/, $data_to_update;
     
    211211    my $dep_id;
    212212    my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb -component $component ";
    213     $command .= " -outdir $out_dir";
     213    $command .= " -outdir $outdir";
    214214    $command .= " -need_magic" if $need_magic;
    215215
  • trunk/pstamp/scripts/pstamp_checkdependent.pl

    r27853 r27874  
    575575    my ($state, $stage, $stage_id, $job_fault) = @_;
    576576
    577     my $command = "$pstamptool -updatejob -state stop -fault $job_fault -dep_id $dep_id";
     577    my $command = "$pstamptool -updatejob -set_state stop -set_fault $job_fault -dep_id $dep_id";
    578578    $command .= " -dbname $dbname" if $dbname;
    579579    $command .= " -dbserver $dbserver" if $dbserver;
     
    642642    carp $msg;
    643643
    644     my $command = "$pstamptool -updatedependent -fault $fault -dep_id $dep_id";
     644    my $command = "$pstamptool -updatedependent -set_fault $fault -dep_id $dep_id";
    645645    $command .= " -dbname $dbname" if $dbname;
    646646    $command .= " -dbserver $dbserver" if $dbserver;
  • trunk/pstamp/scripts/pstamp_dorequest.pl

    r19221 r27874  
    106106{
    107107    ## TODO: what about request status
    108     my $command = "$pstamptool -updatereq -req_id $request_id -state stop";
     108    my $command = "$pstamptool -updatereq -req_id $request_id -set_state stop";
    109109    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    110110        run(command => $command, verbose => $verbosity);
  • trunk/pstamp/scripts/pstamp_finish.pl

    r27751 r27874  
    2525use PS::IPP::PStamp::Job qw( :standard );
    2626
    27 my ( $req_id, $req_name, $req_file, $out_dir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output);
     27my ( $req_id, $req_name, $req_file, $outdir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output);
    2828
    2929# the char to the right of the bar may be used as a single - alias for the longer name
     
    3434           'req_file=s'     => \$req_file,
    3535           'product=s'      => \$product,
    36            'out_dir=s'      => \$out_dir,
     36           'outdir=s'      => \$outdir,
    3737           'dbname=s'       => \$dbname,
    3838           'dbserver=s'     => \$dbserver,
     
    4444pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4545
    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;
     46die "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;
    4848
    4949my $ipprc = PS::IPP::Config->new(); # IPP Configuration
    5050if ($redirect_output) {
    51     my $logDest = "$out_dir/psfinish.$req_id.log";
     51    my $logDest = "$outdir/psfinish.$req_id.log";
    5252    $ipprc->redirect_output($logDest);
    5353}
     
    8282    my $fileset = $req_name;
    8383
    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) {
    8787        # 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";
    9292            stop_request_and_exit($req_id, $PS_EXIT_UNKNOWN_ERROR);
    9393        }
    9494
    9595
    96     } elsif (! -d $out_dir ) {
     96    } elsif (! -d $outdir ) {
    9797        # XXX TODO: fault the request so we pstamp_finish doesn't keep trying to process the
    9898        # 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";
    100100        stop_request_and_exit($req_id, $PS_EXIT_UNKNOWN_ERROR);
    101101    }
     
    122122    # the following is for a postage stamp request
    123123
    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);
    125125    print $rlf "results.fits|||table|\n";
    126126    print $rlf "results.mdc|||text|\n";
    127127
    128128    my $err_file = "parse_error.txt";
    129     if (-e "$out_dir/$err_file" ) {
     129    if (-e "$outdir/$err_file" ) {
    130130        print $rlf "$err_file|||text|\n";
    131131    }
    132132
    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);
    134134
    135135
     
    208208
    209209        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";
    211211            if (open JRL, "<$jreglist") {;
    212212                # process the reglist file to get the list of files produced by this job
     
    225225                    # If not found check the PHU. If that doesn't work just set them to zero.
    226226                    # 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`;
    228228                    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`;
    230230                    }
    231231                    $ra_deg = 0.0 if (!$ra_deg);
     
    258258    # make the results file
    259259    {
    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";
    261261        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    262262            run(command => $command, verbose => $verbose);
     
    266266        } else {
    267267            # 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";
    269269            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    270270                run(command => $command, verbose => $verbose);
     
    278278        # register the fileset
    279279        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;
    282283
    283284        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    292293    # set the request's state to stop
    293294    {
    294         my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $request_fault";
     295        my $command = "$pstamptool -updatereq -req_id $req_id -set_state stop -set_fault $request_fault";
    295296        $command   .= " -dbname $dbname" if $dbname;
    296297        $command   .= " -dbserver $dbserver" if $dbserver;
     
    308309    my $fault  = shift;
    309310
    310     my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $fault";
     311    my $command = "$pstamptool -updatereq -req_id $req_id -set_state stop -set_fault $fault";
    311312    $command   .= " -dbname $dbname" if $dbname;
    312313    $command   .= " -dbserver $dbserver" if $dbserver;
  • trunk/pstamp/scripts/pstamp_get_image_job.pl

    r26215 r27874  
    8787}
    8888
    89 my $out_dir = dirname($output_base);
     89my $outdir = dirname($output_base);
    9090my $prefix = basename($output_base) . "_";
    9191my $results_file = $output_base . ".bundle_results";
     
    102102    my $command = "$dist_bundle --camera $camera --stage $stage --stage_id $stage_id";
    103103    $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";
    105105    $command .= " --prefix $prefix";
    106106    $command .= " --magicked" if $magicked;
     
    139139}
    140140
    141 my $reglist = "$out_dir/reglist$job_id";
     141my $reglist = "$outdir/reglist$job_id";
    142142if (! open(REGLIST, ">$reglist") ) {
    143143    my_die("failed to open registration list: $reglist", $PS_EXIT_UNKNOWN_ERROR);
  • trunk/pstamp/scripts/pstamp_job_run.pl

    r27859 r27874  
    198198# mark the job stopped in the database
    199199{
    200     my $command = "$pstamptool -updatejob -job_id $job_id -state 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;
    202202    $command .= " -dbname $dbname" if $dbname;
    203203    $command .= " -dbserver $dbserver" if $dbserver;
     
    343343        my $command = "$pstamptool -updatejob";
    344344        $command .= " -job_id $job_id";
    345         $command .= " -fault $exit_code";
     345        $command .= " -set_fault $exit_code";
    346346        # XXX: fix pstamptool to not require -state when -fault with nonzero value is provided
    347         $command .= " -state run";
     347        $command .= " -set_state run";
    348348        $command .= " -dbname $dbname" if defined $dbname;
    349349        $command .= " -dbserver $dbserver" if defined $dbserver;
  • trunk/pstamp/scripts/pstamp_parser_run.pl

    r27859 r27874  
    2828my $redirect_output;
    2929my $product;
     30my $outdir;
    3031my $label;
    3132my $verbose;
     
    3738    'uri=s'             =>  \$uri,
    3839    'product=s'         =>  \$product,
     40    'outdir=s'          =>  \$outdir,
    3941    'label=s'           =>  \$label,
    4042    'redirect-output'   =>  \$redirect_output,
     
    8183}
    8284
    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,
     85if (!$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
     98if (! -e $outdir ) {
     99    mkdir $outdir or my_die("failed to create working directory $outdir for request id $req_id", $req_id,
    89100        $PS_EXIT_CONFIG_ERROR);
    90101}
    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   
    97103
    98104if ($redirect_output) {
    99     my $logDest = "$workdir/psparse.$req_id.log";
     105    my $logDest = "$outdir/psparse.$req_id.log";
    100106    $ipprc->redirect_output($logDest);
    101107}
     
    108114
    109115my $fn = basename($uri);
    110 my $new_uri = "$workdir/$fn";
     116my $new_uri = "$outdir/$fn";
    111117if ($uri =~ /^http:/) {
    112118    # if the uri is an http uri download the file
     
    123129    }
    124130    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);
    126132    }
    127133}
     
    173179    # that they sent us a request file that we don't understand
    174180
    175     my $command = "$pstamptool -updatereq -req_id $req_id -state 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";
    178184    $command   .= " -dbname $dbname" if $dbname;
    179185    $command   .= " -dbserver $dbserver" if $dbserver;
     
    186192}
    187193
    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";
    189195$parse_cmd .= " --dbname $dbname" if $dbname;
    190196$parse_cmd .= " --dbserver $dbserver" if $dbserver;
     
    194200my $fault;
    195201{
    196     my $error_file_name = "$workdir/parse_error.txt";
     202    my $error_file_name = "$outdir/parse_error.txt";
    197203    # get rid of any error file from previous attempt to parse this request
    198204    unlink $error_file_name if (-e $error_file_name);
     
    227233#
    228234{
    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;
    233240    $command   .= " -dbname $dbname" if $dbname;
    234241    $command   .= " -dbserver $dbserver" if $dbserver;
     
    269276    carp($msg);
    270277
    271     my $command = "$pstamptool -updatereq -req_id $req_id  -fault $fault";
     278    my $command = "$pstamptool -updatereq -req_id $req_id  -set_fault $fault";
    272279    $command   .= " -dbname $dbname" if $dbname;
    273280    $command   .= " -dbserver $dbserver" if $dbserver;
  • trunk/pstamp/scripts/pstampparse.pl

    r27854 r27874  
    2525my $request_file_name;
    2626my $mode = "list_uri";
    27 my $out_dir;
     27my $outdir;
    2828my $product;
    2929my $label;
     
    3434    'file=s'    =>  \$request_file_name,
    3535    'req_id=s'  =>  \$req_id,
    36     'out_dir=s' =>  \$out_dir,
     36    'outdir=s' =>  \$outdir,
    3737    'product=s' =>  \$product,
    3838    'label=s'   =>  \$label,
     
    5050if ($mode ne "list_uri") {
    5151    die "req_id is required"   if !$req_id;
    52     die "out_dir is required"  if !$out_dir;
     52    die "outdir is required"  if !$outdir;
    5353    die "product is required"  if !$product;
    5454}
     
    129129    # update the database with the request name. This will be used as the
    130130    # 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";
    133133    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    134134        run(command => $command, verbose => $verbose);
     
    522522    $base =~ s/.fits$//;
    523523           
    524     my $output_base = "$out_dir/${rownum}_${job_num}_${base}";
     524    my $output_base = "$outdir/${rownum}_${job_num}_${base}";
    525525    my $argslist = "${output_base}.args";
    526526
     
    712712        my $exp_id = $image->{exp_id};
    713713           
    714         my $output_base = "$out_dir/${rownum}_${job_num}";
     714        my $output_base = "$outdir/${rownum}_${job_num}";
    715715
    716716        write_params($output_base, $image);
     
    894894
    895895    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";
    897897    $command .= " -need_magic" if $need_magic;
    898898
  • trunk/pstamp/scripts/request_finish.pl

    r24831 r27874  
    2121use PS::IPP::Config qw( :standard );
    2222
    23 my ( $req_id, $req_name, $req_file, $req_type, $out_dir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output );
     23my ( $req_id, $req_name, $req_file, $req_type, $outdir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output );
    2424
    2525GetOptions(
     
    2828           'req_file=s' => \$req_file,
    2929           'req_type=s' => \$req_type,
    30            'out_dir=s'  => \$out_dir,
     30           'outdir=s'  => \$outdir,
    3131           'product=s'  => \$product,
    3232           'dbname=s'   => \$dbname,
     
    4646$err .= "--req_name is required\n" if !$req_name;
    4747$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;
    4949
    5050die "$err" if $err;
    5151
    5252
    53 if (!$out_dir) {
    54     $out_dir = dirname($req_file);
     53if (!$outdir) {
     54    $outdir = dirname($req_file);
    5555}
    5656
    5757if ($redirect_output) {
    58     my $logDest = "$out_dir/reqfinish.$req_id.log";
     58    my $logDest = "$outdir/reqfinish.$req_id.log";
    5959    my $ipprc = PS::IPP::Config->new();
    6060    $ipprc->redirect_output($logDest);
     
    7979}
    8080if ($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";
    8282    $command   .= " --dbname $dbname" if $dbname;
    8383    $command   .= " --dbserver $dbserver" if $dbserver;
Note: See TracChangeset for help on using the changeset viewer.