def initialize(self, base_results_dir, drone_hostnames, results_repository_hostname): self._results_dir = base_results_dir drones.set_temporary_directory(os.path.join( base_results_dir, drone_utility._TEMPORARY_DIRECTORY)) for hostname in drone_hostnames: drone = self._add_drone(hostname) drone.call('initialize', base_results_dir) if not self._drones: # all drones failed to initialize raise DroneManagerError('No valid drones found') self.refresh_drone_configs() logging.info('Using results repository on %s', results_repository_hostname) self._results_drone = drones.get_drone(results_repository_hostname)
def _add_drone(self, hostname): """ Forked from drone_manager.py Catches AutoservRunError if the drone fails initialization and does not add it to the list of usable drones. @param hostname: Hostname of the drone we are trying to add. """ logging.info('Adding drone %s' % hostname) drone = drones.get_drone(hostname) if drone: try: drone.call('initialize', self.absolute_path('')) except error.AutoservRunError as e: logging.error('Failed to initialize drone %s with error: %s', hostname, e) return self._drones[drone.hostname] = drone
def initialize(self, base_results_dir, drone_hostnames, results_repository_hostname): self._results_dir = base_results_dir for hostname in drone_hostnames: self._add_drone(hostname) if not self._drones: # all drones failed to initialize raise DroneManagerError("No valid drones found") self.refresh_drone_configs() logging.info("Using results repository on %s", results_repository_hostname) self._results_drone = drones.get_drone(results_repository_hostname) results_installation_dir = global_config.global_config.get_config_value( scheduler_config.CONFIG_SECTION, "results_host_installation_directory", default=None ) if results_installation_dir: self._results_drone.set_autotest_install_dir(results_installation_dir)
def initialize(self, base_results_dir, drone_hostnames, results_repository_hostname): self._results_dir = base_results_dir for hostname in drone_hostnames: self._add_drone(hostname) if not self._drones: # all drones failed to initialize raise DroneManagerError('No valid drones found') self.refresh_drone_configs() logging.info('Using results repository on %s', results_repository_hostname) self._results_drone = drones.get_drone(results_repository_hostname) results_installation_dir = global_config.global_config.get_config_value( scheduler_config.CONFIG_SECTION, 'results_host_installation_directory', default=None) if results_installation_dir: self._results_drone.set_autotest_install_dir( results_installation_dir)
def _add_drone(self, hostname): logging.info('Adding drone %s', hostname) drone = drones.get_drone(hostname) if drone: self._drones[drone.hostname] = drone drone.call('initialize', self.absolute_path(''))
def _add_drone(self, hostname): logging.info('Adding drone %s' % hostname) drone = drones.get_drone(hostname) self._drones[drone.hostname] = drone return drone
def _add_drone(self, hostname): logging.info("Adding drone %s" % hostname) drone = drones.get_drone(hostname) if drone: self._drones[drone.hostname] = drone drone.call("initialize", self.absolute_path(""))