[autotest] Reset shouldn't unconditionally put host into Ready.

The current transitions go

    Ready -> Resetting -> Ready -> Pending

whereas this should look like

    Ready -> Resetting -> Pending

The extra Ready doesn't really matter, since we immediately change it
later, but it'd be nice to remove it for sanity reasons.

BUG=chromium:266051
DEPLOY=scheduler
STATUS=verified
TEST=There is no longer an extra Ready.

Change-Id: Ic9925ac6016bce750e6638e777930c6e8944d54a
Reviewed-on: https://gerrit.chromium.org/gerrit/63770
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
diff --git a/scheduler/monitor_db.py b/scheduler/monitor_db.py
index 52e78bf..88fdb85 100755
--- a/scheduler/monitor_db.py
+++ b/scheduler/monitor_db.py
@@ -1861,10 +1861,11 @@
 
         if self.success:
             self.host.update_field('dirty', 0)
-            self.host.set_status(models.Host.Status.READY)
 
             if self._should_pending():
                 self.queue_entry.on_pending()
+            else:
+                self.host.set_status(models.Host.Status.READY)
 
 
 class AbstractQueueTask(AgentTask, TaskWithJobKeyvals):