diff --git a/cmflib/dvc_wrapper.py b/cmflib/dvc_wrapper.py index f4844a63..692eb0a3 100644 --- a/cmflib/dvc_wrapper.py +++ b/cmflib/dvc_wrapper.py @@ -55,6 +55,8 @@ def dvc_get_hash(folder: str, repo: str = "") -> str: def git_get_commit() -> str: + process = "" + commit = "" try: process = subprocess.Popen(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE, @@ -73,6 +75,7 @@ def git_get_commit() -> str: def commit_dvc_lock_file(file_path: str, execution_id) -> str: commit = "" + process = "" try: process = subprocess.Popen(['git', 'add', file_path], stdout=subprocess.PIPE, @@ -102,6 +105,7 @@ def commit_dvc_lock_file(file_path: str, execution_id) -> str: def commit_output(folder: str, execution_id: str) -> str: commit = "" + process = "" try: process = subprocess.Popen(['dvc', 'add', folder], stdout=subprocess.PIPE, @@ -140,6 +144,9 @@ def commit_output(folder: str, execution_id: str) -> str: # Get the remote repo def git_get_repo() -> str: commit = "" + process = "" + output = "" + errs = "" try: process = subprocess.Popen(['git', 'remote', '-v'], stdout=subprocess.PIPE, diff --git a/cmflib/metadata_helper.py b/cmflib/metadata_helper.py index 403d2de2..abeb2ab6 100644 --- a/cmflib/metadata_helper.py +++ b/cmflib/metadata_helper.py @@ -86,7 +86,8 @@ def get_or_create_artifact_type(store, type_name, properties: dict = None) -> me try: artifact_type = store.get_artifact_type(type_name=type_name) return artifact_type - except: + except Exception as e: + print(e) artifact_type = metadata_store_pb2.ArtifactType( name=type_name, properties=properties, @@ -99,7 +100,8 @@ def get_or_create_execution_type(store, type_name, properties: dict = None) -> m try: execution_type = store.get_execution_type(type_name=type_name) return execution_type - except: + except Exception as e: + print(e) execution_type = metadata_store_pb2.ExecutionType( name=type_name, properties=properties, @@ -112,7 +114,8 @@ def get_or_create_context_type(store, type_name, properties: dict = None) -> met try: context_type = store.get_context_type(type_name=type_name) return context_type - except: + except Exception as e: + print(e) context_type = metadata_store_pb2.ContextType( name=type_name, properties=properties, @@ -213,7 +216,8 @@ def get_or_create_context_with_type( ) -> metadata_store_pb2.Context: try: context = get_context_by_name(store, context_name) - except: + except Exception as e: + print(e) context = create_context_with_type( store=store, context_name=context_name, @@ -340,6 +344,7 @@ def associate_child_to_parent_context(store, parent_context: metadata_store_pb2. associate = metadata_store_pb2.ParentContext(child_id=child_context.id, parent_id=parent_context.id) store.put_parent_contexts([associate]) except Exception as e: + print(e) # print('Warning: Exception:{}'.format(str(e)), file=sys.stderr) sys.stderr.flush()