IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23176


Ignore:
Timestamp:
Mar 4, 2009, 8:53:53 AM (17 years ago)
Author:
eugene
Message:

replace errors that result in changes to the fault value, cleanup errors change the data state; camtool uses -set_state to set the state (not -state)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/eam_branch_20090303/ippScripts/scripts/ipp_cleanup.pl

    r22750 r23176  
    4545    defined $mode;
    4646
    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?
     52
    5053unless (($mode eq "goto_cleaned") || ($mode eq "goto_scrubbed") || ($mode eq "goto_purged")) {
    5154    die "invalid cleanup mode $mode\n";   
    5255}
     56
     57my $error_state;
     58if ($mode eq "goto_cleaned")  { $error_state = "error_cleaned";  }
     59if ($mode eq "goto_scrubbed") { $error_state = "error_scrubbed"; }
     60if ($mode eq "goto_purged")   { $error_state = "error_purged";   }
     61
    5362
    5463my %stages = ( chip => 1, camera => 1, fake => 1, warp => 1, stack => 1, diff  => 1);
     
    150159            }
    151160        } else {
    152             # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will stop be run
    153             my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -code 1";
     161            # if an error happens for a chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*)
     162            my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -set_state $error_state";
    154163            $command .= " -dbname $dbname" if defined $dbname;
    155164
     
    218227
    219228    if ($status)  {
    220         my $command = "$camtool -cam_id $stage_id -updaterun";
     229        my $command;
    221230        if ($mode eq "goto_cleaned") {
    222             $command .= " -state cleaned";
    223         } else {
    224             $command .= " -state purged";
     231            $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned";
     232        }
     233        if ($mode eq "goto_scrubbed") {
     234            $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned";
     235        }
     236        if ($mode eq "goto_purged") {
     237            $command = "$camtool -updaterun -cam_id $stage_id -set_state purged";
    225238        }
    226239        $command .= " -dbname $dbname" if defined $dbname;
     
    232245        }
    233246    } else {
    234         my $command = "$camtool -updateprocessedexp -cam_id $stage_id -code 1";
     247        # since 'camera' has only a single imfile, we can just update the run
     248        my $command = "$camtool -updaterun -cam_id $stage_id -set_state $error_state";
    235249        $command .= " -dbname $dbname" if defined $dbname;
    236250
     
    321335            }
    322336         } else {
    323             # XXX: -updateskyfile mode does not exist, need to add it
    324             my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -code 1";
     337            my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state";
    325338            $command .= " -dbname $dbname" if defined $dbname;
    326339
     
    339352# left TODO
    340353# fake : faketool : -pendingcleanupimfile (loop over imfiles)
    341 # stack: stacktool : -pendingcleanupskyfile (loop over skyfiles)
    342 # diff:  difftool : -pendingcleanupskyfile
     354# stack: stacktool : -pendingcleanupskyfile
     355# diff:  difftool : -pendingcleanupskyfile (loop over skyfiles)
    343356
    344357die "ipp_cleanup.pl -stage $stage not yet implemented\n";
     
    369382}
    370383
     384# XXX we currently do not set the error state in the db on my_die
    371385sub my_die
    372386{
Note: See TracChangeset for help on using the changeset viewer.