blob: 2eb6f910dee9b032e3d34fe451db501f7bef2119 [file] [log] [blame]
Derek Becketta20b12a2021-08-27 15:04:44 -07001# Lint as: python2, python3
2# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6import common
7
8from autotest_lib.server.hosts import abstract_ssh
9
10
11class GenericHost(abstract_ssh.AbstractSSHHost):
12 """Chromium OS specific subclass of Host."""
13
14 @staticmethod
15 def check_host(host, timeout=10):
16 """Check if the host is alive."""
17 try:
18 host.run('test -e')
19
20 return True
21 except Exception:
22 return False
23
24 def _initialize(self, hostname, *args, **dargs):
25 """Initialize superclasses."""
26 super(GenericHost, self)._initialize(hostname=hostname, *args, **dargs)