Fix up the importing in server/hosts to not be so fragile. Importing
utils from these modules was just a bad idea (it depends on the server
dir being in sys.path) and the circular references between some of the
modules are making things unnecessarily fragile.
The main changes are:
- converted all of the imports from the server directory and from
the common lib into absolute imports (i.e. from autotest_lib.*)
- moved the RemoteHost definition into a remote.py file, so that
SiteHost can subclass Host without introducing a circular
dependency between base_classes and site_host
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1417 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/server_job.py b/server/server_job.py
index bc39916..14b1ec6 100755
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -140,7 +140,7 @@
client
True if a client-side control file
"""
- path = os.path.dirname(sys.modules['server_job'].__file__)
+ path = os.path.dirname(__file__)
self.autodir = os.path.abspath(os.path.join(path, '..'))
self.serverdir = os.path.join(self.autodir, 'server')
self.testdir = os.path.join(self.serverdir, 'tests')