Changeset 24831
- Timestamp:
- Jul 16, 2009, 5:14:07 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (3 diffs)
-
ippTasks/pstamp.pro (modified) (4 diffs)
-
pstamp/scripts/dquery_finish.pl (modified) (5 diffs)
-
pstamp/scripts/dqueryparse.pl (modified) (5 diffs)
-
pstamp/scripts/pstamp_finish.pl (modified) (9 diffs)
-
pstamp/scripts/pstamp_job_run.pl (modified) (7 diffs)
-
pstamp/scripts/pstamp_listjobs.pl (modified) (2 diffs)
-
pstamp/scripts/pstamp_parser_run.pl (modified) (6 diffs)
-
pstamp/scripts/pstamp_queue_requests.pl (modified) (6 diffs)
-
pstamp/scripts/pstamp_revert_request.pl (modified) (4 diffs)
-
pstamp/scripts/pstamp_webrequest.pl (modified) (4 diffs)
-
pstamp/scripts/pstampparse.pl (modified) (6 diffs)
-
pstamp/scripts/request_finish.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r23292 r24831 210 210 my $base; 211 211 212 next if ($img_type eq "warp" and $image->{ignored}); 212 next if $image->{fault}; 213 next if ($img_type ne "raw") and $image->{quality}; 213 214 214 215 if ($base_name) { … … 542 543 my $project_name = shift; 543 544 my $dbname = shift; 545 my $dbserver = shift; 544 546 die "project is not defined" if !$project_name; 545 547 … … 555 557 my $command = "$pstamptool -project -name $project_name"; 556 558 $command .= " -dbname $dbname" if defined $dbname; 559 $command .= " -dbserver $dbserver" if defined $dbserver; 557 560 # run the tool and parse the output 558 561 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = -
trunk/ippTasks/pstamp.pro
r23230 r24831 8 8 $pstampJob_DB = 0 9 9 $pstampFin_DB = 0 10 11 # set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config 12 # warning: no quotes around the two words. it cause it to get passed to pstamptool as one word 13 # tricky to debug problem ensues 14 # example: 15 # $PSDBSERVER = -dbserver hostname 16 $PS_DBSERVER = "" 10 17 11 18 macro pstamp.reset … … 115 122 116 123 task.exec 124 $run = pstamptool -pendingreq 117 125 if ($DB:n == 0) 118 126 option DEFAULT 119 command pstamptool -pendingreq120 127 else 121 128 option $DB:$pstampReq_DB 122 command pstamptool -pendingreq-dbname $DB:$pstampReq_DB129 $run = $run $PS_DBSERVER -dbname $DB:$pstampReq_DB 123 130 $pstampReq_DB ++ 124 131 if ($pstampReq_DB >= $DB:n) set pstampReq_DB = 0 125 132 end 133 add_poll_args run 134 command $run 126 135 end 127 136 … … 213 222 else 214 223 option $DB:$pstampFin_DB 215 command pstamptool -completedreq -dbname $DB:$pstampFin_DB 224 command pstamptool -completedreq -dbname $DB:$pstampFin_DB $PS_DBSERVER 216 225 $pstampFin_DB ++ 217 226 if ($pstampFin_DB >= $DB:n) set pstampFin_DB = 0 … … 307 316 else 308 317 option $DB:$pstampJob_DB 309 command pstamptool -pendingjob -limit 10 -dbname $DB:$pstampJob_DB 318 command pstamptool -pendingjob -limit 10 -dbname $DB:$pstampJob_DB $PS_DBSERVER 310 319 $pstampJob_DB ++ 311 320 if ($pstampJob_DB >= $DB:n) set pstampJob_DB = 0 -
trunk/pstamp/scripts/dquery_finish.pl
r19221 r24831 20 20 use PS::IPP::Config qw( :standard ); 21 21 22 my ( $req_id, $req_name, $req_file, $product, $dbname, $ verbose, $save_temps );22 my ( $req_id, $req_name, $req_file, $product, $dbname, $dbserver, $verbose, $save_temps ); 23 23 24 24 GetOptions( … … 28 28 'product=s' => \$product, 29 29 'dbname=s' => \$dbname, 30 'dbserver=s' => \$dbserver, 30 31 'verbose' => \$verbose, 31 32 'save-temps' => \$save_temps, … … 56 57 my $outputDataStoreRoot = metadataLookupStr($ipprc->{_siteConfig}, 'DATA_STORE_ROOT'); 57 58 exit ($PS_EXIT_CONFIG_ERROR) unless defined $outputDataStoreRoot; # lookup failure outputs a message 59 60 if (!$dbserver) { 61 $dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); 62 } 58 63 59 64 if ($product eq "NULL") { … … 89 94 my $command = "$pstamptool -listjob -req_id $req_id"; 90 95 $command .= " -dbname $dbname" if $dbname; 96 $command .= " -dbserver $dbserver" if $dbserver; 91 97 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 92 98 run(command => $command, verbose => $verbose); … … 149 155 $command .= " -fault $fault" if $fault; 150 156 $command .= " -dbname $dbname" if $dbname; 157 $command .= " -dbserver $dbserver" if $dbserver; 151 158 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 152 159 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/dqueryparse.pl
r19221 r24831 26 26 ); 27 27 28 my ($req_file, $req_id, $out_dir, $product, $mode, $dbname, $ verbose, $save_temps);28 my ($req_file, $req_id, $out_dir, $product, $mode, $dbname, $dbserver, $verbose, $save_temps); 29 29 30 30 # … … 39 39 'mode=s' => \$mode, 40 40 'dbname=s' => \$dbname, 41 'dbserver=s' => \$dbserver, 41 42 'verbose' => \$verbose, 42 43 'save-temps' => \$save_temps, … … 69 70 warn("Can't find required tools."); 70 71 exit ($PS_EXIT_CONFIG_ERROR); 72 } 73 74 if (!$dbserver) { 75 my $ipprc = = PS::IPP::Config->new(); 76 $dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); 71 77 } 72 78 … … 131 137 $command .= " -rownum 0"; 132 138 $command .= " -dbname $dbname" if $dbname; 139 $command .= " -dbserver $dbserver" if $dbserver; 133 140 134 141 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 153 160 $command .= " -fault $result" if $result; 154 161 $command .= " -dbname $dbname" if $dbname; 162 $command .= " -dbserver $dbserver" if $dbserver; 155 163 156 164 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = -
trunk/pstamp/scripts/pstamp_finish.pl
r23267 r24831 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); … … 251 257 my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $request_fault"; 252 258 $command .= " -dbname $dbname" if $dbname; 259 $command .= " -dbserver $dbserver" if $dbserver; 253 260 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 254 261 run(command => $command, verbose => $verbose); … … 263 270 my $req_id = shift; 264 271 my $fault = shift; 265 my $dbname = shift;266 272 267 273 my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $fault"; 268 274 $command .= " -dbname $dbname" if $dbname; 275 $command .= " -dbserver $dbserver" if $dbserver; 269 276 270 277 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = -
trunk/pstamp/scripts/pstamp_job_run.pl
r23267 r24831 17 17 my $verbose; 18 18 my $dbname; 19 my $dbserver; 19 20 my $job_id; 20 21 my $redirect_output; … … 25 26 26 27 GetOptions( 27 'job_id=s' => \$job_id, 28 'output_base=s' => \$output_base, 29 'redirect-output' => \$redirect_output, 30 'dbname=s' => \$dbname, 31 'verbose' => \$verbose, 28 'job_id=s' => \$job_id, 29 'output_base=s' => \$output_base, 30 'redirect-output' => \$redirect_output, 31 'dbname=s' => \$dbname, 32 'dbserver=s' => \$dbserver, 33 'verbose' => \$verbose, 32 34 ); 33 35 … … 65 67 } 66 68 69 if (!$dbserver) { 70 $dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); 71 } 72 67 73 my $missing_tools; 68 74 … … 83 89 my $command = "$pstamptool -pendingjob -job_id $job_id"; 84 90 $command .= " -dbname $dbname" if $dbname; 91 $command .= " -dbserver $dbserver" if $dbserver; 85 92 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 86 93 run(command => $command, verbose => $verbose); … … 118 125 my $command = "$ppstamp -file $uri $outputBase $argString"; 119 126 $command .= " -dbname $dbname" if $dbname; 127 $command .= " -dbserver $dbserver" if $dbserver; 120 128 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 121 129 run(command => $command, verbose => $verbose); … … 172 180 my $command = "$pstamp_get_image_job --job_id $job_id --uri $uri --out_dir $outputBase --rownum $rownum"; 173 181 $command .= " --dbname $dbname" if $dbname; 182 $command .= " --dbserver $dbserver" if $dbserver; 174 183 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 175 184 run(command => $command, verbose => $verbose); … … 191 200 my $command = "$pstamptool -updatejob -job_id $job_id -state stop -fault $jobStatus"; 192 201 $command .= " -dbname $dbname" if $dbname; 202 $command .= " -dbserver $dbserver" if $dbserver; 193 203 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 194 204 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstamp_listjobs.pl
r21410 r24831 12 12 my $verbose; 13 13 my $dbname; 14 my $dserver; 14 15 15 16 GetOptions( 16 17 'verbose' => \$verbose, 17 18 'dbname=s' => \$dbname, 19 'dbserver=s'=> \$dbserver, 18 20 ); 19 21 … … 68 70 my $command = "$pstamptool -listjob -req_id $request_id"; 69 71 $command .= " -dbname $dbname" if $dbname; 72 $command .= " -dbserver $dbserver" if $dbserver; 70 73 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 71 74 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstamp_parser_run.pl
r21410 r24831 20 20 my $verbose; 21 21 my $dbname; 22 my $dbserver; 22 23 23 24 GetOptions( … … 28 29 'verbose' => \$verbose, 29 30 'dbname=s' => \$dbname, 31 'dbserver=s' => \$dbserver, 30 32 ); 31 33 … … 67 69 my $pstamp_workdir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_WORKDIR'); 68 70 exit ($PS_EXIT_CONFIG_ERROR) unless defined $pstamp_workdir; # lookup failure outputs a message 71 72 if (!$dbserver) { 73 $dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); 74 } 69 75 70 76 # workdir is where we download request files to and place any error output from the parser … … 167 173 $command .= " -fault $PS_EXIT_DATA_ERROR"; 168 174 $command .= " -dbname $dbname" if $dbname; 175 $command .= " -dbserver $dbserver" if $dbserver; 169 176 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 170 177 run(command => $command, verbose => $verbose); … … 177 184 $parse_cmd .= " --mode queue_job --req_id $req_id --product $product --out_dir $workdir --file $uri"; 178 185 $parse_cmd .= " --dbname $dbname" if $dbname; 186 $parse_cmd .= " --dbserver $dbserver" if $dbserver; 179 187 $parse_cmd .= " --verbose" if $verbose; 180 188 … … 218 226 $command .= " -fault $fault" if $fault; 219 227 $command .= " -dbname $dbname" if $dbname; 228 $command .= " -dbserver $dbserver" if $dbserver; 220 229 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 221 230 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstamp_queue_requests.pl
r21410 r24831 17 17 my $verbose; 18 18 my $dbname; 19 my $dbserver; 19 20 my $limit; 20 21 … … 22 23 'verbose' => \$verbose, 23 24 'dbname=s' => \$dbname, 25 'dbserver=s' => \$dbserver, 24 26 'limit=i' => \$limit, 25 27 ); … … 59 61 } 60 62 63 my $ipprc = PS::IPP::Config->new(); 61 64 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 65 66 if (!$dbserver) { 67 $dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); 68 } 62 69 63 70 my @dataStores; … … 66 73 my $command = "$pstamptool -datastore"; 67 74 $command .= " -dbname $dbname" if $dbname; 75 $command .= " -dbserver $dbserver" if $dbserver; 68 76 69 77 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 177 185 my $command = "$pstamptool -addreq -uri $req_uri -ds_id $ds_id"; 178 186 $command .= " -dbname $dbname" if $dbname; 187 $command .= " -dbserver $dbserver" if $dbserver; 179 188 180 189 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 192 201 my $command = "$pstamptool -ds_id $ds_id -moddatastore -last_fileset $lastFileset"; 193 202 $command .= " -dbname $dbname" if $dbname; 203 $command .= " -dbserver $dbserver" if $dbserver; 194 204 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 195 205 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstamp_revert_request.pl
r20256 r24831 31 31 32 32 33 my ( $req_id, $dbname, $ verbose, $save_temps );33 my ( $req_id, $dbname, $dbserver, $verbose, $save_temps ); 34 34 35 35 GetOptions( 36 36 'req_id=s' => \$req_id, 37 37 'dbname=s' => \$dbname, 38 'dbserver=s' => \$dbserver, 38 39 'verbose' => \$verbose, 39 40 'save-temps' => \$save_temps, … … 65 66 my $command = "$pstamptool -listreq -req_id $req_id"; 66 67 $command .= " -dbname $dbname" if $dbname; 68 $command .= " -dbserver $dbserver" if $dbserver; 67 69 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 68 70 run(command => $command, verbose => $verbose); … … 97 99 if ($product and $fileset) { 98 100 my $command = "$dsreg --del $fileset --product $product --rm --force"; 99 $command .= " --dbname $dbname" if $dbname; 101 # don't add dbname let dsreg get it from the DS_DBNAME in site.config 102 # $command .= " --dbname $dbname" if $dbname; 100 103 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 101 104 run(command => $command, verbose => $verbose); … … 109 112 my $command = "$pstamptool -revertreq -req_id $req_id"; 110 113 $command .= " -dbname $dbname" if $dbname; 114 $command .= " -dbserver $dbserver" if $dbserver; 111 115 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 112 116 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstamp_webrequest.pl
r21192 r24831 24 24 my $verbose = 0; 25 25 my $dbname; 26 my $dbserver; 26 27 my $project; 27 28 my $job_type; … … 30 31 'job_type=s' => \$job_type, 31 32 'dbname=s' => \$dbname, 33 'dbserver=s' => \$dbserver, 32 34 'project=s' => \$project, 33 35 'verbose' => \$verbose, … … 101 103 my $command = "$pstampparse --mode list_uri --file $request_file"; 102 104 $command .= " --dbname $dbname" if $dbname; 105 $command .= " --dbserver $dbserver" if $dbserver; 103 106 $command .= " --verbose" if $verbose; 104 107 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 123 126 my $command = "$pstamptool -addreq -uri $request_file -ds_id 0"; 124 127 $command .= " -dbname $dbname" if $dbname; 128 $command .= " -dbserver $dbserver" if $dbserver; 125 129 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 126 130 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstampparse.pl
r23267 r24831 16 16 my $verbose; 17 17 my $dbname; 18 my $dbserver; 18 19 my $req_id; 19 20 my $request_file_name; … … 29 30 'mode=s' => \$mode, 30 31 'dbname=s' => \$dbname, 32 'dbserver=s'=> \$dbserver, 31 33 'verbose' => \$verbose, 32 34 ); … … 89 91 $command .= " -outProduct $product"; 90 92 $command .= " -dbname $dbname" if $dbname; 93 $command .= " -dbserver $dbserver" if $dbserver; 91 94 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 92 95 run(command => $command, verbose => $verbose); … … 143 146 die "job_type is list_uri but mode is $mode" if ($job_type eq "list_uri") and ($mode ne "list_uri"); 144 147 145 my $proj_hash = resolve_project($ipprc, $project, $dbname );148 my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver); 146 149 die "project $project not found\n" unless $proj_hash; 147 150 … … 217 220 . " -uri $listfile -outputBase $out_dir -rownum $rownum"; 218 221 $command .= " -dbname $dbname" if $dbname; 222 $command .= " -dbserver $dbserver" if $dbserver; 219 223 if ($mode eq "list_job") { 220 224 print "$command\n"; … … 274 278 $command .= " -exp_id $exp_id" if $exp_id; 275 279 $command .= " -dbname $dbname" if $dbname; 280 $command .= " -dbserver $dbserver" if $dbserver; 276 281 277 282 if ($mode eq "list_job") { -
trunk/pstamp/scripts/request_finish.pl
r21410 r24831 21 21 use PS::IPP::Config qw( :standard ); 22 22 23 my ( $req_id, $req_name, $req_file, $req_type, $out_dir, $product, $dbname, $ verbose, $save_temps, $redirect_output );23 my ( $req_id, $req_name, $req_file, $req_type, $out_dir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output ); 24 24 25 25 GetOptions( … … 31 31 'product=s' => \$product, 32 32 'dbname=s' => \$dbname, 33 'dbserver=s' => \$dbserver, 33 34 'verbose' => \$verbose, 34 35 'save-temps' => \$save_temps, … … 80 81 my $command = $finish_cmd . " --req_id $req_id --req_name $req_name --req_file $req_file --product $product --out_dir $out_dir"; 81 82 $command .= " --dbname $dbname" if $dbname; 83 $command .= " --dbserver $dbserver" if $dbserver; 82 84 $command .= " --verbose" if $verbose; 83 85 $command .= " --save-temps" if $save_temps; … … 93 95 my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $PS_EXIT_DATA_ERROR"; 94 96 $command .= " -dbname $dbname" if $dbname; 97 $command .= " -dbserver $dbserver" if $dbserver; 95 98 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 96 99 run(command => $command, verbose => $verbose);
Note:
See TracChangeset
for help on using the changeset viewer.
