- Timestamp:
- Aug 7, 2009, 12:45:24 PM (17 years ago)
- Location:
- branches/eam_branches/20090715
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pstamp/scripts/pstamp_finish.pl (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715
- Property svn:mergeinfo changed
/trunk (added) merged: 24801-24824,24827-24834,24836-24859,24861-24901,24903-24912,24914-24950,24953-24971,24973-24977,24986-24989,24993-25017
- Property svn:mergeinfo changed
-
branches/eam_branches/20090715/pstamp/scripts/pstamp_finish.pl
r23267 r25022 24 24 use PS::IPP::PStamp::Job qw( :standard ); 25 25 26 my ( $req_id, $req_name, $req_file, $out_dir, $product, $dbname, $ verbose, $save_temps, $redirect_output);26 my ( $req_id, $req_name, $req_file, $out_dir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output); 27 27 28 28 # the char to the right of the bar may be used as a single - alias for the longer name … … 35 35 'out_dir=s' => \$out_dir, 36 36 'dbname=s' => \$dbname, 37 'dbserver=s' => \$dbserver, 37 38 'verbose' => \$verbose, 38 39 'save-temps' => \$save_temps, … … 50 51 my $logDest = "$out_dir/psfinish.$req_id.log"; 51 52 $ipprc->redirect_output($logDest); 53 } 54 55 if (!$dbserver) { 56 $dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); 52 57 } 53 58 … … 89 94 if (!mkdir $out_dir) { 90 95 print STDERR "cannot create output directory $out_dir"; 91 stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR , $dbname);96 stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR); 92 97 } 93 98 … … 97 102 # request 98 103 print STDERR "output directory $out_dir exists but is not a directory"; 99 stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR , $dbname);104 stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR); 100 105 } 101 106 102 107 if (! -e $req_file ) { 103 108 print STDERR "request file $req_file is missing\n"; 104 stop_request($req_id, $PS_EXIT_CONFIG_ERROR , $dbname);109 stop_request($req_id, $PS_EXIT_CONFIG_ERROR); 105 110 } 106 111 … … 112 117 # point 113 118 print STDERR "failed to read request_file $req_file" ; 114 stop_request($req_id, $PS_EXIT_CONFIG_ERROR , $dbname);119 stop_request($req_id, $PS_EXIT_CONFIG_ERROR); 115 120 } 116 121 … … 138 143 my $command = "$pstamptool -listjob -req_id $req_id"; 139 144 $command .= " -dbname $dbname" if $dbname; 145 $command .= " -dbserver $dbserver" if $dbserver; 140 146 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 141 147 run(command => $command, verbose => $verbose); … … 167 173 } 168 174 175 my $exp_info; 176 my $last_exp_id = -1; 169 177 foreach my $job (@jobs) { 170 178 my $job_id = $job->{job_id}; … … 175 183 176 184 my ($row, $req_info, $project) = get_request_info($rows, $rownum); 177 my $proj_hash = resolve_project($ipprc, $project, $dbname); 185 186 my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver); 178 187 my $image_db = $proj_hash->{dbname}; 179 180 # get the metadata for the exposure (if any i.e. stack) 181 # returns an appropriate string if !$exp_id 182 my $exp_info = get_exposure_info($image_db, $exp_id); 188 if (!$image_db) { 189 carp("failed to find imagedb for project: $project"); 190 stop_request($req_id, $PS_EXIT_CONFIG_ERROR); 191 } 192 193 if ($exp_id ne $last_exp_id) { 194 # get the metadata for the exposure (if any i.e. stack) 195 # returns an appropriate string if !$exp_id 196 $exp_info = get_exposure_info($image_db, $exp_id); 197 $last_exp_id = $exp_id; 198 } 183 199 184 200 if (($job_type eq "stamp") || ($job_type eq "get_image")) { … … 251 267 my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $request_fault"; 252 268 $command .= " -dbname $dbname" if $dbname; 269 $command .= " -dbserver $dbserver" if $dbserver; 253 270 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 254 271 run(command => $command, verbose => $verbose); … … 263 280 my $req_id = shift; 264 281 my $fault = shift; 265 my $dbname = shift;266 282 267 283 my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $fault"; 268 284 $command .= " -dbname $dbname" if $dbname; 285 $command .= " -dbserver $dbserver" if $dbserver; 269 286 270 287 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 285 302 # Create a results file module and provide a list of the names (we have the data in the columns) 286 303 my $rowinfo = "$row->{PROJECT}|$row->{JOB_TYPE}|$row->{REQ_TYPE}|$row->{IMG_TYPE}|"; 287 $rowinfo .= "$row->{ID}|$row->{ CLASS_ID}|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|";304 $rowinfo .= "$row->{ID}|$row->{TESS_ID}|$row->{COMPONENT}|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|"; 288 305 $rowinfo .= "$row->{REQFILT}|$row->{COORD_MASK}|$row->{CENTER_X}|$row->{CENTER_Y}|"; 289 306 $rowinfo .= "$row->{WIDTH}|$row->{HEIGHT}";
Note:
See TracChangeset
for help on using the changeset viewer.
