Make scheduler set host status to "Pending" when there's a pending queue entry against the host.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2292 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/models.py b/frontend/afe/models.py
index f748335..2befdcc 100644
--- a/frontend/afe/models.py
+++ b/frontend/afe/models.py
@@ -118,7 +118,7 @@
     status: string describing status of host
     """
     Status = enum.Enum('Verifying', 'Running', 'Ready', 'Repairing',
-                       'Repair Failed', 'Dead', 'Rebooting',
+                       'Repair Failed', 'Dead', 'Rebooting', 'Pending',
                         string_values=True)
 
     hostname = dbmodels.CharField(maxlength=255, unique=True)
diff --git a/scheduler/monitor_db.py b/scheduler/monitor_db.py
index e4e4b5a..2d109e6 100644
--- a/scheduler/monitor_db.py
+++ b/scheduler/monitor_db.py
@@ -1889,6 +1889,7 @@
         otherwise.
         """
         self.set_status('Pending')
+        self.get_host().set_status('Pending')
         if self.job.is_ready():
             return self.job.run(self)
         return None