Refactor scheduler models into a separate module, scheduler_models.  This module doesn't depend on monitor_db, only the other way around.  The separation and isolation of dependencies should help us organize the scheduler code a bit better.

This was made possible largely by the many changes we made late last year to improve statelessness of the scheduler.  It was motivated here by my work on pluggable metahost handlers, which will need to depend on scheduler models.  Without this separation, we'd end up with circular dependencies.

Also includes some fixes for metahost schedulers.

Signed-off-by: Steve Howard <showard@google.com>


Property changes on: scheduler/scheduler_models.py


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4252 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/status_server.py b/scheduler/status_server.py
index a35ed6b..29d23db 100644
--- a/scheduler/status_server.py
+++ b/scheduler/status_server.py
@@ -1,6 +1,6 @@
 import os, BaseHTTPServer, cgi, threading, urllib, fcntl, logging
 import common
-from autotest_lib.scheduler import scheduler_config
+from autotest_lib.scheduler import drone_manager, scheduler_config
 
 _PORT = 13467
 
@@ -90,13 +90,13 @@
 
 
 class StatusServer(BaseHTTPServer.HTTPServer):
-    def __init__(self, drone_manager):
+    def __init__(self):
         address = ('', _PORT)
         # HTTPServer is an old-style class :(
         BaseHTTPServer.HTTPServer.__init__(self, address,
                                            StatusServerRequestHandler)
         self._shutting_down = False
-        self._drone_manager = drone_manager
+        self._drone_manager = drone_manager.instance()
 
         # ensure the listening socket is not inherited by child processes
         old_flags = fcntl.fcntl(self.fileno(), fcntl.F_GETFD)