def _get_project_source(base_cls, project_config_path, project_root, template_file): try: return { "source": str(project_config_path), "config": base_cls._dict_from_file(project_config_path, fail_ok=False), } except FileNotFoundError as e: error = e try: legacy_conf = parse_legacy_config(project_root) return { "source": str(project_root / "ci/taskcat.yml"), "config": legacy_conf.to_dict(), } except Exception as e: # pylint: disable=broad-except LOG.debug(str(e), exc_info=True) if not template_file: # pylint: disable=raise-missing-from raise error
def convert(project_root: str = "./", ): # pylint: disable=too-many-locals """Converts config from legacy to new format.""" project_root_path: Path = Path(project_root).expanduser().resolve() parse_legacy_config(project_root_path)