def __init__(self, output_dir, target_cpu, host=None, port=None, ssh_config=None, system_log_file=None): """output_dir: The directory which will contain the files that are generated to support the deployment. target_cpu: The CPU architecture of the deployment target. Can be "x64" or "arm64". host: The address of the deployment target device. port: The port of the SSH service on the deployment target device. ssh_config: The path to SSH configuration data.""" super(DeviceTarget, self).__init__(output_dir, target_cpu) self._port = 22 self._auto = not host or not ssh_config self._new_instance = True self._system_log_file = system_log_file self._loglistener = None if self._auto: self._ssh_config_path = EnsurePathExists( boot_data.GetSSHConfigPath(output_dir)) else: self._ssh_config_path = os.path.expanduser(ssh_config) self._host = host if port: self._port = port self._new_instance = False
def __init__(self, output_dir, target_cpu, host=None, node_name=None, port=None, ssh_config=None, fuchsia_out_dir=None, os_check='update', system_log_file=None): """output_dir: The directory which will contain the files that are generated to support the deployment. target_cpu: The CPU architecture of the deployment target. Can be "x64" or "arm64". host: The address of the deployment target device. node_name: The node name of the deployment target device. port: The port of the SSH service on the deployment target device. ssh_config: The path to SSH configuration data. fuchsia_out_dir: The path to a Fuchsia build output directory, for deployments to devices paved with local Fuchsia builds. os_check: If 'check', the target's SDK version must match. If 'update', the target will be repaved if the SDK versions mismatch. If 'ignore', the target's SDK version is ignored.""" super(DeviceTarget, self).__init__(output_dir, target_cpu) self._port = port if port else 22 self._system_log_file = system_log_file self._host = host self._fuchsia_out_dir = fuchsia_out_dir self._node_name = node_name self._os_check = os_check self._amber_repo = None if self._host and self._node_name: raise Exception( 'Only one of "--host" or "--name" can be specified.') if self._fuchsia_out_dir: if ssh_config: raise Exception( 'Only one of "--fuchsia-out-dir" or "--ssh_config" can ' 'be specified.') self._fuchsia_out_dir = os.path.expanduser(fuchsia_out_dir) # Use SSH keys from the Fuchsia output directory. self._ssh_config_path = os.path.join(self._fuchsia_out_dir, 'ssh-keys', 'ssh_config') self._os_check = 'ignore' elif ssh_config: # Use the SSH config provided via the commandline. self._ssh_config_path = os.path.expanduser(ssh_config) else: # Default to using an automatically generated SSH config and keys. boot_data.ProvisionSSH(output_dir) self._ssh_config_path = boot_data.GetSSHConfigPath(output_dir)
def _GetSshConfigPath(self): return boot_data.GetSSHConfigPath(self._output_dir)
def _GetSshConfigPath(self): return boot_data.GetSSHConfigPath()