Example #1
0
 def test_download_scp(self):
     kpath = join(self.temp_local_dir, 'tmp-key')
     copyfile(self.test_ssh_key, kpath)
     download_remote('scp://runner@localhost:'+self.remote_dir_path,
                     kpath, self.temp_local_dir)
     local_files = self._get_valid_files(self.temp_local_dir)
     self.assertCountEqual(local_files, self.exp_files)
     self.assertFalse(exists(kpath))
Example #2
0
def download_remote_files(job):
    """Downloads valid study files from a remote server

    Parameters
    ----------
    job : qiita_db.processing_job.ProcessingJob
        The processing job performing the task
    """
    with qdb.sql_connection.TRN:
        url = job.parameters.values['url']
        destination = job.parameters.values['destination']
        private_key = job.parameters.values['private_key']
        try:
            download_remote(url, private_key, destination)
        except Exception:
            job._set_error(traceback.format_exception(*exc_info()))
        else:
            job._set_status('success')
Example #3
0
def download_remote_files(job):
    """Downloads valid study files from a remote server

    Parameters
    ----------
    job : qiita_db.processing_job.ProcessingJob
        The processing job performing the task
    """
    with qdb.sql_connection.TRN:
        url = job.parameters.values['url']
        destination = job.parameters.values['destination']
        private_key = job.parameters.values['private_key']
        try:
            download_remote(url, private_key, destination)
        except Exception:
            job._set_error(traceback.format_exception(*exc_info()))
        else:
            job._set_status('success')
Example #4
0
 def test_download_sftp(self):
     download_remote('sftp://localhost:' + self.remote_dir_path,
                     self.test_ssh_key, self.temp_local_dir)
     local_files = self._get_valid_files(self.temp_local_dir)
     self.assertCountEqual(local_files, self.exp_files)
Example #5
0
 def test_download_sftp(self):
     download_remote('sftp://localhost:'+self.remote_dir_path,
                     self.test_ssh_key, self.temp_local_dir)
     local_files = self._get_valid_files(self.temp_local_dir)
     self.assertCountEqual(local_files, self.exp_files)