Moved in the inheritance tree repair_* from abstract_ssh to Host base class.

WARNING: this change may break compatibility with existent site_host.repair_* 
overrides if they depend on the AbstractSSHHost moved repair_* functions to run
before the site_host.repair_* ones. If so the site_host.repair_* functions 
should be changed to call the super().repair_* at the end of them.

Signed-off-by: Mihai Rusu <[email protected]>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@2685 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/hosts/abstract_ssh.py b/server/hosts/abstract_ssh.py
index 78b11a9..fe91d0d 100644
--- a/server/hosts/abstract_ssh.py
+++ b/server/hosts/abstract_ssh.py
@@ -1,4 +1,4 @@
-import os, sys, time, types, socket, traceback, shutil, glob
+import os, time, types, socket, shutil, glob
 from autotest_lib.client.common_lib import error, debug
 from autotest_lib.server import utils, autotest
 from autotest_lib.server.hosts import site_host
@@ -295,9 +295,10 @@
 
         return False
 
+
     # tunable constants for the verify & repair code
     AUTOTEST_GB_DISKSPACE_REQUIRED = 20
-    HOURS_TO_WAIT_FOR_RECOVERY = 2.5
+
 
     def verify(self):
         super(AbstractSSHHost, self).verify()
@@ -319,33 +320,6 @@
             pass            # autotest dir may not exist, etc. ignore
 
 
-    def repair_filesystem_only(self):
-        super(AbstractSSHHost, self).repair_filesystem_only()
-
-        TIMEOUT = int(self.HOURS_TO_WAIT_FOR_RECOVERY * 3600)
-        if self.is_shutting_down():
-            print 'Host is shutting down, waiting for a restart'
-            self.wait_for_restart(TIMEOUT)
-        else:
-            self.wait_up(TIMEOUT)
-        self.reboot()
-
-
-    def repair_full(self):
-        super(AbstractSSHHost, self).repair_full()
-        try:
-            self.repair_filesystem_only()
-            self.verify()
-        except Exception:
-            # the filesystem-only repair failed, try something more drastic
-            print "Filesystem-only repair failed"
-            traceback.print_exc()
-            try:
-                self.machine_install()
-            except NotImplementedError, e:
-                sys.stderr.write(str(e) + "\n\n")
-
-
 class LoggerFile(object):
     def write(self, data):
         if data: