Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 27993)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 28015)
@@ -528,15 +528,17 @@
         my $data_state = $image->{data_state};
         $data_state = $run_state if $stage eq 'stack';
-        if (($run_state eq 'goto_purged') or ($data_state eq 'purged') or
-            ($run_state eq 'drop') or 
-            ($run_state eq 'error_cleaned') or ($data_state eq 'error_cleaned') or
-            ($run_state eq 'goto_scrubbed') or ($data_state eq 'scrubbed')) {
+        if (($run_state =~ /purged/) or ($run_state =~ /scrubbed/)) {
             # image is gone and it's not coming back
             $newState = 'stop';
             $fault = $PSTAMP_GONE;
+        } elsif (($run_state eq "error_cleaned") or ($data_state eq 'error_cleaned')) {
+            # if cleanup had an error don't get the user's hopes up
+            $newState = 'stop';
+            $fault = $PSTAMP_NOT_AVAILABLE;
         } elsif (($data_state ne 'full') or ($need_magic and ($image->{magicked} < 0))) {
             if ($stage eq 'chip') {
                 my $burntool_state = $image->{burntool_state};
-                if ($burntool_state and (abs($burntool_state) < 14)) {
+                # XXX: get value 13 from ppImage recipe 
+                if ($burntool_state and (abs($burntool_state) < 13)) {
                     $newState = 'stop';
                     $fault = $PSTAMP_NOT_AVAILABLE;
@@ -708,9 +710,14 @@
             my $data_state = $image->{data_state};
             $data_state = $run_state if $stage eq "stack";
-            if (($run_state eq 'goto_purged') or ($data_state eq 'purged') or
-                ($run_state eq 'goto_scrubbed') or ($data_state eq 'scrubbed')) {
+#            if (($run_state eq 'goto_purged') or ($data_state eq 'purged') or
+#                ($run_state eq 'goto_scrubbed') or ($data_state eq 'scrubbed')) {
+            if (($run_state =~ /purged/) or ($run_state =~ /scrubbed/)) {
                 # image is gone and it's not coming back
                 $newState = 'stop';
                 $fault = $PSTAMP_GONE;
+            } elsif ($run_state eq "error_cleaned") {
+                # if cleanup had an error don't get the user's hopes up
+                $newState = 'stop';
+                $fault = $PSTAMP_NOT_AVAILABLE;
             } elsif (($data_state ne 'full') or ($need_magic and ($image->{magicked} < 0))) {
                 # wait for update unless the customer asks us to not to
