Пример #1
0
    def __init__(self,
                 host,
                 username=None,
                 port=None,
                 config=None,
                 extra_ssh_flags=None,
                 extra_scp_flags=None):
        super(SSHExecutor, self).__init__()

        self.user_prefix = username + '@' if username else ''
        self.host = host
        self.port = port
        self.config = config
        self.scp_command = ['scp'] if port is None else [
            'scp', '-P', str(port)
        ]
        if extra_scp_flags:
            self.scp_command.extend(extra_scp_flags)
        self.ssh_command = ['ssh'] if port is None else [
            'ssh', '-p', str(port)
        ]
        if extra_ssh_flags:
            self.ssh_command.extend(extra_ssh_flags)
        self.remote_host_failed_connections = 0

        # TODO(jroelofs): switch this on some -super-verbose-debug config flag
        # TODO: this breaks multiprocessing
        if self.config and self.config.lit_config.debug and False:
            self.local_run = tracing.trace_function(self.local_run,
                                                    log_calls=True,
                                                    log_results=True,
                                                    label='ssh_local')
Пример #2
0
 def __init__(self,
              host,
              nfs_dir,
              path_in_target,
              config=None,
              username=None,
              port=None,
              extra_ssh_flags=None,
              extra_scp_flags=None):
     super(SSHExecutorWithNFSMount,
           self).__init__(host,
                          config=config,
                          username=username,
                          port=port,
                          extra_ssh_flags=extra_ssh_flags,
                          extra_scp_flags=extra_scp_flags)
     self.nfs_dir = nfs_dir
     if not self.nfs_dir.endswith('/'):
         self.nfs_dir = self.nfs_dir + '/'
     self.path_in_target = path_in_target
     if not self.path_in_target.endswith('/'):
         self.path_in_target = self.path_in_target + '/'
     # TODO: this breaks multiprocessing
     if self.config and self.config.lit_config.debug and False:
         self._remote_temp = tracing.trace_function(self._remote_temp,
                                                    log_calls=False,
                                                    log_results=True,
                                                    label='ssh-exec')
         self._copy_in_file = tracing.trace_function(self._copy_in_file,
                                                     log_calls=True,
                                                     log_results=False,
                                                     label='ssh-exec')
         self.delete_remote = tracing.trace_function(self.delete_remote,
                                                     log_calls=True,
                                                     log_results=False,
                                                     label='ssh-exec')
         self.run = tracing.trace_function(self.run,
                                           log_calls=True,
                                           log_results=True,
                                           label='ssh-exec')
Пример #3
0
    def __init__(self, host, username=None):
        super(SSHExecutor, self).__init__()

        self.user_prefix = username + '@' if username else ''
        self.host = host
        self.scp_command = 'scp'
        self.ssh_command = 'ssh'

        # TODO(jroelofs): switch this on some -super-verbose-debug config flag
        if False:
            self.local_run = tracing.trace_function(
                self.local_run, log_calls=True, log_results=True,
                label='ssh_local')
Пример #4
0
    def __init__(self, host, username=None):
        super(SSHExecutor, self).__init__()

        self.user_prefix = username + '@' if username else ''
        self.host = host
        self.scp_command = 'scp'
        self.ssh_command = 'ssh'

        # TODO(jroelofs): switch this on some -super-verbose-debug config flag
        if False:
            self.local_run = tracing.trace_function(
                self.local_run, log_calls=True, log_results=True,
                label='ssh_local')