autotest: Delete an SSH roundtrip in CrosHost.reboot()
This would often timeout and fail because reboot() is used in response
to the DUT not being available over SSH.
BUG=chromium:881209
TEST=python
> import common
> from autotest_lib.server import hosts
> from server import site_utils as server_utils
> from autotest_lib.server.hosts import host_info
> h = hosts.create_host(machine={
'hostname': 'SOME_HOSTNAME',
'afe_host': server_utils.EmptyAFEHost(),
'host_info_store': host_info.InMemoryHostInfoStore(
host_info.HostInfo(label=['board:link'])),
})
> h.reboot()
Change-Id: Ic7411c348dd93fbb76bf87198a061ce643c82943
Reviewed-on: https://chromium-review.googlesource.com/1227377
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
diff --git a/server/hosts/cros_host.py b/server/hosts/cros_host.py
index f7a248f..755fe70 100644
--- a/server/hosts/cros_host.py
+++ b/server/hosts/cros_host.py
@@ -1034,19 +1034,15 @@
if 'fastsync' not in dargs:
dargs['fastsync'] = True
- # For purposes of logging reboot times:
- # Get the board name i.e. 'daisy_spring'
- board_fullname = self.get_board()
-
- # Strip the prefix and add it to dargs.
- dargs['board'] = board_fullname[board_fullname.find(':')+1:]
+ dargs['board'] = self.host_info_store.get().board
# Record who called us
orig = sys._getframe(1).f_code
metric_fields = {'board' : dargs['board'],
'dut_host_name' : self.hostname,
'success' : True}
metric_debug_fields = {'board' : dargs['board'],
- 'caller' : "%s:%s" % (orig.co_filename, orig.co_name),
+ 'caller' : "%s:%s" % (orig.co_filename,
+ orig.co_name),
'success' : True,
'error' : ''}