[autotest] Drop uses of CrosHost._get_board_from_afe
BUG=chromium:678430
TEST=unittests
Change-Id: I1df262a0f600a791c0c35326b1b459cd931eded3
Reviewed-on: https://chromium-review.googlesource.com/439890
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@google.com>
diff --git a/server/hosts/cros_firmware.py b/server/hosts/cros_firmware.py
index 1c43b6a..41c2eda 100644
--- a/server/hosts/cros_firmware.py
+++ b/server/hosts/cros_firmware.py
@@ -256,8 +256,13 @@
if not _is_firmware_update_supported(host):
return
# Test 2 - The DUT has an assigned stable firmware version.
- stable_firmware = afe_utils.get_stable_firmware_version(
- host._get_board_from_afe())
+ info = host.host_info_store.get()
+ if info.board is None:
+ raise hosts.AutoservVerifyError(
+ 'Can not verify firmware version. '
+ 'No board label value found')
+
+ stable_firmware = afe_utils.get_stable_firmware_version(info.board)
if stable_firmware is None:
# This DUT doesn't have a firmware update target
return
diff --git a/server/hosts/cros_host.py b/server/hosts/cros_host.py
index 6de91ef..2f420d8 100644
--- a/server/hosts/cros_host.py
+++ b/server/hosts/cros_host.py
@@ -331,8 +331,12 @@
def _get_cros_repair_image_name(self):
- return afe_utils.get_stable_cros_image_name(
- self._get_board_from_afe())
+ info = self.host_info_store.get()
+ if info.board is None:
+ raise error.AutoservError('Cannot obtain repair image name. '
+ 'No board label value found')
+
+ return afe_utils.get_stable_cros_image_name(info.board)
def verify_job_repo_url(self, tag=''):