From 54138bb04c5e4e0946b4aa0927611e69ff8eac76 Mon Sep 17 00:00:00 2001 From: jonawals Date: Fri, 9 Jul 2021 04:13:44 +0100 Subject: [PATCH] Properly handle creation of TIAF historic workspace directory (#2006) * Fix historic working dir creation Signed-off-by: John * Add new line at EOF Signed-off-by: John * Removing extra whitespace at end of file Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Log global exception caught by TIAF driver Signed-off-by: John Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- scripts/build/TestImpactAnalysis/tiaf.py | 2 +- scripts/build/TestImpactAnalysis/tiaf_driver.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build/TestImpactAnalysis/tiaf.py b/scripts/build/TestImpactAnalysis/tiaf.py index 5ae76d8269..304982a84d 100644 --- a/scripts/build/TestImpactAnalysis/tiaf.py +++ b/scripts/build/TestImpactAnalysis/tiaf.py @@ -93,7 +93,7 @@ class TestImpact: self.__has_src_commit = True def __write_last_run_hash(self, last_run_hash): - os.mkdir(self.__historic_workspace) + os.makedirs(self.__historic_workspace, exist_ok=True) f = open(self.__last_commit_hash_path, "w") f.write(last_run_hash) f.close() diff --git a/scripts/build/TestImpactAnalysis/tiaf_driver.py b/scripts/build/TestImpactAnalysis/tiaf_driver.py index a9be7c8cbc..42234f803d 100644 --- a/scripts/build/TestImpactAnalysis/tiaf_driver.py +++ b/scripts/build/TestImpactAnalysis/tiaf_driver.py @@ -60,6 +60,6 @@ if __name__ == "__main__": # Non-gating will be removed from this script and handled at the job level in SPEC-7413 #sys.exit(return_code) sys.exit(0) - except: + except Exception as e: # Non-gating will be removed from this script and handled at the job level in SPEC-7413 - sys.exit(0) \ No newline at end of file + print(f"Exception caught by TIAF driver: {e}")