IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28015 for trunk/pstamp/scripts


Ignore:
Timestamp:
May 18, 2010, 4:16:25 PM (16 years ago)
Author:
bills
Message:

Better reporting of errors to client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstampparse.pl

    r27993 r28015  
    528528        my $data_state = $image->{data_state};
    529529        $data_state = $run_state if $stage eq 'stack';
    530         if (($run_state eq 'goto_purged') or ($data_state eq 'purged') or
    531             ($run_state eq 'drop') or
    532             ($run_state eq 'error_cleaned') or ($data_state eq 'error_cleaned') or
    533             ($run_state eq 'goto_scrubbed') or ($data_state eq 'scrubbed')) {
     530        if (($run_state =~ /purged/) or ($run_state =~ /scrubbed/)) {
    534531            # image is gone and it's not coming back
    535532            $newState = 'stop';
    536533            $fault = $PSTAMP_GONE;
     534        } elsif (($run_state eq "error_cleaned") or ($data_state eq 'error_cleaned')) {
     535            # if cleanup had an error don't get the user's hopes up
     536            $newState = 'stop';
     537            $fault = $PSTAMP_NOT_AVAILABLE;
    537538        } elsif (($data_state ne 'full') or ($need_magic and ($image->{magicked} < 0))) {
    538539            if ($stage eq 'chip') {
    539540                my $burntool_state = $image->{burntool_state};
    540                 if ($burntool_state and (abs($burntool_state) < 14)) {
     541                # XXX: get value 13 from ppImage recipe
     542                if ($burntool_state and (abs($burntool_state) < 13)) {
    541543                    $newState = 'stop';
    542544                    $fault = $PSTAMP_NOT_AVAILABLE;
     
    708710            my $data_state = $image->{data_state};
    709711            $data_state = $run_state if $stage eq "stack";
    710             if (($run_state eq 'goto_purged') or ($data_state eq 'purged') or
    711                 ($run_state eq 'goto_scrubbed') or ($data_state eq 'scrubbed')) {
     712#            if (($run_state eq 'goto_purged') or ($data_state eq 'purged') or
     713#                ($run_state eq 'goto_scrubbed') or ($data_state eq 'scrubbed')) {
     714            if (($run_state =~ /purged/) or ($run_state =~ /scrubbed/)) {
    712715                # image is gone and it's not coming back
    713716                $newState = 'stop';
    714717                $fault = $PSTAMP_GONE;
     718            } elsif ($run_state eq "error_cleaned") {
     719                # if cleanup had an error don't get the user's hopes up
     720                $newState = 'stop';
     721                $fault = $PSTAMP_NOT_AVAILABLE;
    715722            } elsif (($data_state ne 'full') or ($need_magic and ($image->{magicked} < 0))) {
    716723                # wait for update unless the customer asks us to not to
Note: See TracChangeset for help on using the changeset viewer.