Exemple #1
0
    def _ssh_ls(self, uri):
        """Helper for ls(); obeys globbing"""
        m = SSH_URI_RE.match(uri)
        try:
            addr = m.group('hostname')
            if not addr:
                raise ValueError

            if '!' in addr and self.ssh_key_name is None:
                raise ValueError('ssh_key_name must not be None')

            output = ssh_ls(
                self._ssh_bin,
                addr,
                self._ec2_key_pair_file,
                m.group('filesystem_path'),
                self.ssh_key_name,
            )

            for line in output:
                # skip directories, we only want to return downloadable files
                if line and not line.endswith('/'):
                    yield SSH_PREFIX + addr + line
        except SSHException, e:
            raise IOError(e)
Exemple #2
0
    def _ssh_ls(self, uri):
        """Helper for ls(); obeys globbing"""
        m = SSH_URI_RE.match(uri)
        try:
            addr = m.group('hostname')
            if not addr:
                raise ValueError

            if '!' in addr and self.ssh_key_name is None:
                raise ValueError('ssh_key_name must not be None')

            output = ssh_ls(
                self._ssh_bin,
                addr,
                self._ec2_key_pair_file,
                m.group('filesystem_path'),
                self.ssh_key_name,
            )

            for line in output:
                # skip directories, we only want to return downloadable files
                if line and not line.endswith('/'):
                    yield SSH_PREFIX + addr + line
        except SSHException, e:
            raise IOError(e)
Exemple #3
0
    def _ssh_ls(self, uri):
        """Helper for ls(); obeys globbing"""
        m = SSH_URI_RE.match(uri)
        addr = m.group('hostname')
        if not addr:
            raise ValueError

        keyfile = self._key_filename_for(addr)

        output = ssh_ls(
            self._ssh_bin,
            addr,
            self._ec2_key_pair_file,
            m.group('filesystem_path'),
            keyfile,
        )

        for line in output:
            # skip directories, we only want to return downloadable files
            if line and not line.endswith('/'):
                yield SSH_PREFIX + addr + line
Exemple #4
0
    def _ssh_ls(self, uri):
        """Helper for ls(); obeys globbing"""
        m = _SSH_URI_RE.match(uri)
        addr = m.group('hostname')
        if not addr:
            raise ValueError

        keyfile = self._key_filename_for(addr)

        output = ssh_ls(
            self._ssh_bin,
            addr,
            self._ec2_key_pair_file,
            m.group('filesystem_path'),
            keyfile,
        )

        for line in output:
            # skip directories, we only want to return downloadable files
            if line and not line.endswith('/'):
                yield 'ssh://' + addr + line