| OLD | NEW |
| 1 import os, sys, subprocess, logging | 1 import os, sys, subprocess, logging |
| 2 | 2 |
| 3 from autotest_lib.client.common_lib import utils, error | 3 from autotest_lib.client.common_lib import utils, error |
| 4 from autotest_lib.server import utils as server_utils | 4 from autotest_lib.server import utils as server_utils |
| 5 from autotest_lib.server.hosts import remote | 5 from autotest_lib.server.hosts import remote |
| 6 | 6 |
| 7 | 7 |
| 8 SiteHost = utils.import_site_class( | 8 SiteHost = utils.import_site_class( |
| 9 __file__, "autotest_lib.server.hosts.site_host", "SiteHost", | 9 __file__, "autotest_lib.server.hosts.site_host", "SiteHost", |
| 10 remote.RemoteHost) | 10 remote.RemoteHost) |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 except error.AutoservShutdownError: | 158 except error.AutoservShutdownError: |
| 159 logging.warning(warning_msg, attempt+1, num_attempts) | 159 logging.warning(warning_msg, attempt+1, num_attempts) |
| 160 # re-send the hard reset command | 160 # re-send the hard reset command |
| 161 self.run_conmux(conmux_command) | 161 self.run_conmux(conmux_command) |
| 162 else: | 162 else: |
| 163 break | 163 break |
| 164 else: | 164 else: |
| 165 # Run on num_attempts=1 or last retry | 165 # Run on num_attempts=1 or last retry |
| 166 try: | 166 try: |
| 167 self.wait_for_restart(timeout, | 167 self.wait_for_restart(timeout, |
| 168 old_boot_id=old_boot_id, | |
| 169 **wait_for_restart_kwargs) | 168 **wait_for_restart_kwargs) |
| 170 except error.AutoservShutdownError: | 169 except error.AutoservShutdownError: |
| 171 logging.warning(warning_msg, num_attempts, num_attempts) | 170 logging.warning(warning_msg, num_attempts, num_attempts) |
| 172 msg = "Host did not shutdown" | 171 msg = "Host did not shutdown" |
| 173 raise error.AutoservShutdownError(msg) | 172 raise error.AutoservShutdownError(msg) |
| 174 | 173 |
| 175 if self.job: | 174 if self.job: |
| 176 self.job.disable_warnings("POWER_FAILURE") | 175 self.job.disable_warnings("POWER_FAILURE") |
| 177 try: | 176 try: |
| 178 if wait: | 177 if wait: |
| 179 self.log_reboot(reboot) | 178 self.log_reboot(reboot) |
| 180 else: | 179 else: |
| 181 reboot() | 180 reboot() |
| 182 finally: | 181 finally: |
| 183 if self.job: | 182 if self.job: |
| 184 self.job.enable_warnings("POWER_FAILURE") | 183 self.job.enable_warnings("POWER_FAILURE") |
| OLD | NEW |