[autotest] Do not create AfeHost in server_job in Skylab.
In Skylab, host information is provided via a prepopulated HostInfoStore
file. In this case, the AFE is not available. So, create a fake AfeHost.
BUG=chromium:851206
TEST=pre-cq
Change-Id: I299148e6b454fec538b33b133f1aa9f329c0197b
Reviewed-on: https://chromium-review.googlesource.com/1097506
Tested-by: Prathmesh Prabhu <[email protected]>
Trybot-Ready: Prathmesh Prabhu <[email protected]>
Reviewed-by: Xixuan Wu <[email protected]>
diff --git a/server/server_job.py b/server/server_job.py
index e9774b4..1237505 100644
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -124,14 +124,14 @@
afe_host.attributes.update(host_attributes)
info = host_info.HostInfo(attributes=host_attributes)
host_info_store.commit(info)
- else:
+ elif use_shadow_store:
afe_host = _create_afe_host(machine)
- if use_shadow_store:
- host_info_store = _create_afe_backed_host_info_store(store_dir,
- machine)
- else:
- host_info_store = _create_file_backed_host_info_store(store_dir,
- machine)
+ host_info_store = _create_afe_backed_host_info_store(store_dir,
+ machine)
+ else:
+ afe_host = server_utils.EmptyAFEHost()
+ host_info_store = _create_file_backed_host_info_store(store_dir,
+ machine)
machine_dict_list.append({
'hostname' : machine,