From a4a2b231571ba9742b9608f0fcf775f1e5875256 Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Thu, 19 Oct 2023 14:29:37 -0500 Subject: [PATCH] debug git cache --- src/engine/src/helpers/GitCacheService.py | 6 +++++- src/engine/src/helpers/TemplateMapper.py | 7 +++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/src/helpers/GitCacheService.py b/src/engine/src/helpers/GitCacheService.py index 79a3a511..ea5b198f 100644 --- a/src/engine/src/helpers/GitCacheService.py +++ b/src/engine/src/helpers/GitCacheService.py @@ -11,14 +11,18 @@ def add(self, url: str, directory: str): git.Repo.clone_from(url, os.path.join(self._cache_dir, directory.lstrip("/"))) def repo_exists(self, path): + print("REPO EXISTS", os.path.exists(path)) return os.path.exists(path) def update(self, directory): + print("GIT PULL", directory) git.cmd.Git(directory).pull() def add_or_update(self, url, directory): + print("ADD OR UPDATE", directory) if not self.repo_exists(directory): + print("CREATING", url, directory) self.add(url, directory) return - + print("UPDATING", directory) self.update(directory) \ No newline at end of file diff --git a/src/engine/src/helpers/TemplateMapper.py b/src/engine/src/helpers/TemplateMapper.py index 57d7f851..2f813f37 100644 --- a/src/engine/src/helpers/TemplateMapper.py +++ b/src/engine/src/helpers/TemplateMapper.py @@ -13,7 +13,6 @@ TapisActorTask ) -from pprint import pprint class TemplateMapper: def __init__(self, cache_dir: str): @@ -37,8 +36,7 @@ def map(self, obj: Union[Pipeline, Task], uses: Uses) -> Union[Pipeline, Task]: # Clone git repository specified on the pipeline.uses if exists template = self.template_repo.get_by_uses(uses) - print("TEMPLATE TO BE MAPPED") - pprint(template) + # Resolve which class the final object should have obj_class = Pipeline if not issubclass(obj.__class__, Pipeline): @@ -81,4 +79,5 @@ def map(self, obj: Union[Pipeline, Task], uses: Uses) -> Union[Pipeline, Task]: if getattr(obj, attr) != updated_value: setattr(obj, attr, updated_value) - return obj \ No newline at end of file + return obj +