Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: scheduler/drones.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scheduler/drones.py
diff --git a/scheduler/drones.py b/scheduler/drones.py
index 85a5ee297e4c95ad1df05b41a2dea924a7eb6d85..b742b55bcd8917b9cf1481636aa37f51331f135d 100644
--- a/scheduler/drones.py
+++ b/scheduler/drones.py
@@ -7,6 +7,11 @@ from autotest_lib.client.common_lib import error, global_config
AUTOTEST_INSTALL_DIR = global_config.global_config.get_config_value('SCHEDULER',
'drone_installation_directory')
+class DroneUnreachable(Exception):
+ """The drone is non-sshable."""
+ pass
+
+
class _AbstractDrone(object):
"""
Attributes:
@@ -111,6 +116,9 @@ class _RemoteDrone(_AbstractDrone):
super(_RemoteDrone, self).__init__()
self.hostname = hostname
self._host = drone_utility.create_host(hostname)
+ if not self._host.is_up():
+ logging.error('Drone %s is unpingable, kicking out', hostname)
+ raise DroneUnreachable
self._autotest_install_dir = AUTOTEST_INSTALL_DIR
@@ -156,4 +164,7 @@ def get_drone(hostname):
"""
if hostname == 'localhost':
return _LocalDrone()
- return _RemoteDrone(hostname)
+ try:
+ return _RemoteDrone(hostname)
+ except DroneUnreachable:
+ return None
« cli/job.py ('K') | « scheduler/drone_manager.py ('k') | scheduler/metahost_scheduler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698