def stage_out_files(self): """ Stage out files from fs backend to stageout area. """ task_logger = create_task_logger(logger, self.task.pk) # first we need a stage out directory task_logger.info("Stageout to %s", self.task.stageout) backend_for_stageout = FSBackend.urifactory(self.yabiusername, self.task.stageout) backend_for_stageout.mkdir(self.task.stageout) # now the stageout proper method = self.task.job.preferred_stageout_method src = self.working_output_dir_uri() dst = self.task.stageout if method == 'lcopy' and not is_same_location(src, dst): method = 'copy' task_logger.info("Stageout: %sing '%s' to '%s'", method, src, dst) if method == 'lcopy': return self.local_copy_recursive(src, dst) if method == 'copy': return FSBackend.remote_copy(self.yabiusername, src, dst) raise RuntimeError("Invalid stageout method %s for task %s" % (method, self.task.pk))
def determine_stagein_method(self, src, dst): preferred_stagein_method = self.job.preferred_stagein_method if is_same_location(src, dst): method = preferred_stagein_method else: method = 'copy' return method