From a3689d9c0459c45f1298914cca646728806e7ad2 Mon Sep 17 00:00:00 2001 From: ejseqera Date: Thu, 29 Jun 2023 00:21:03 -0400 Subject: [PATCH] fix: revert skipping overwrite for pipelines --- tw_pywrap/overwrite.py | 4 +--- tw_pywrap/tower.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tw_pywrap/overwrite.py b/tw_pywrap/overwrite.py index 5aaa275..7d02ab0 100644 --- a/tw_pywrap/overwrite.py +++ b/tw_pywrap/overwrite.py @@ -88,9 +88,7 @@ def handle_overwrite(self, block, args, overwrite=False): else: self.block_operations["participants"]["name_key"] = "email" - if block != "pipelines" and self.check_resource_exists( - operation["name_key"], tw_args - ): + if self.check_resource_exists(operation["name_key"], tw_args): # if resource exists, delete if overwrite: logging.debug( diff --git a/tw_pywrap/tower.py b/tw_pywrap/tower.py index 58f5385..fdafae2 100644 --- a/tw_pywrap/tower.py +++ b/tw_pywrap/tower.py @@ -68,10 +68,10 @@ def _tw_run(self, cmd, *args, **kwargs): # Error handling for stdout if stdout: - if re.search(r"ERROR: (?!A pipeline).* already exists", stdout): + if re.search(r"ERROR: .* already exists", stdout): raise ResourceExistsError( " Resource already exists and will not be created." - "Please set 'overwrite: true'\n" + " Please set 'overwrite: true'\n" ) elif re.search(r"ERROR: .*", stdout): raise ResourceCreationError(