Пример #1
0
    def pre_copy(self,
                 container_id=None,
                 dest_path=None,
                 src_file=None,
                 exist_file=None):
        if not dest_path:
            self.logger.error(
                "There has no dest_path in {} config file.".format(
                    self.testcase.name()))
            return None
        if src_file:
            self.testcase.mk_src_file()
            file_path = dt_cfg.dovetail_config[self.type]['result']['dir']
            src_path = os.path.join(file_path, src_file)
        if exist_file:
            file_path = dt_cfg.dovetail_config[self.type]['config']['dir']
            src_path = os.path.join(file_path, 'pre_config', exist_file)

        Container.copy_file(container_id, src_path, dest_path)
        return dest_path