Changeset 23229 for trunk/ippScripts/scripts/ipp_cleanup.pl
- Timestamp:
- Mar 8, 2009, 4:50:46 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/ipp_cleanup.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/eam_branches/eam_branch_20090303 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/ippScripts/scripts/ipp_cleanup.pl
r23186 r23229 45 45 my $ipprc = PS::IPP::Config->new( $camera ) or my_die("Unable to set up", $stage_id, $PS_EXIT_CONFIG_ERROR); # this is used for PATH, NEB filename conversions 46 46 47 # $mode must be one of "goto_cleaned", "goto_scrubbed", or "goto_purged" 48 # goto_cleaned and goto_scrubbed both result in 'cleaned': scrubbed allows chips without config files to 49 # be cleaned (they cannot be recovered, but the small data is left behind) 47 # $mode must be one of "goto_cleaned", "goto_scrubbed", or 48 # "goto_purged" goto_cleaned and goto_scrubbed both result in 49 # 'cleaned' on success ('scrubbed' allows chips without config files 50 # to be cleaned; they cannot be recovered, but the small data is left 51 # behind). XXX make 'scrubbed' a data_state? 50 52 unless (($mode eq "goto_cleaned") || ($mode eq "goto_scrubbed") || ($mode eq "goto_purged")) { 51 53 die "invalid cleanup mode $mode\n"; 52 54 } 55 56 my $error_state; 57 if ($mode eq "goto_cleaned") { $error_state = "error_cleaned"; } 58 if ($mode eq "goto_scrubbed") { $error_state = "error_scrubbed"; } 59 if ($mode eq "goto_purged") { $error_state = "error_purged"; } 60 53 61 54 62 my %stages = ( chip => 1, camera => 1, fake => 1, warp => 1, stack => 1, diff => 1); … … 148 156 } 149 157 } else { 150 # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will stop be run 151 my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -code 1"; 152 $command .= " -dbname $dbname" if defined $dbname; 158 159 # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*) 160 my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -set_state $error_state"; 161 $command .= " -dbname $dbname" if defined $dbname; 153 162 154 163 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 216 225 217 226 if ($status) { 218 my $command = "$camtool -cam_id $stage_id -updaterun";227 my $command; 219 228 if ($mode eq "goto_cleaned") { 220 $command .= " -state cleaned"; 221 } else { 222 $command .= " -state purged"; 229 $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned"; 230 } 231 if ($mode eq "goto_scrubbed") { 232 $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned"; 233 } 234 if ($mode eq "goto_purged") { 235 $command = "$camtool -updaterun -cam_id $stage_id -set_state purged"; 223 236 } 224 237 $command .= " -dbname $dbname" if defined $dbname; … … 230 243 } 231 244 } else { 232 my $command = "$camtool -updateprocessedexp -cam_id $stage_id -code 1"; 245 # since 'camera' has only a single imfile, we can just update the run 246 my $command = "$camtool -updaterun -cam_id $stage_id -set_state $error_state"; 233 247 $command .= " -dbname $dbname" if defined $dbname; 234 248 … … 319 333 } 320 334 } else { 321 # XXX: -updateskyfile mode does not exist, need to add it 322 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -code 1"; 323 $command .= " -dbname $dbname" if defined $dbname; 335 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state"; 336 $command .= " -dbname $dbname" if defined $dbname; 324 337 325 338 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 337 350 # left TODO 338 351 # fake : faketool : -pendingcleanupimfile (loop over imfiles) 339 # stack: stacktool : -pendingcleanupskyfile (loop over skyfiles)340 # diff: difftool : -pendingcleanupskyfile 352 # stack: stacktool : -pendingcleanupskyfile 353 # diff: difftool : -pendingcleanupskyfile (loop over skyfiles) 341 354 342 355 die "ipp_cleanup.pl -stage $stage not yet implemented\n"; … … 367 380 } 368 381 382 # XXX we currently do not set the error state in the db on my_die 369 383 sub my_die 370 384 {
Note:
See TracChangeset
for help on using the changeset viewer.
