Derek Beckett | a20b12a | 2021-08-27 15:04:44 -0700 | [diff] [blame^] | 1 | # 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 | |
| 6 | import common |
| 7 | |
| 8 | from autotest_lib.server.hosts import abstract_ssh |
| 9 | |
| 10 | |
| 11 | class 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) |