From a1e28a30aebe790c6ec5653b6e969927443566ce Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Fri, 23 Aug 2024 13:13:38 -0700 Subject: [PATCH] fix Signed-off-by: Sayali Gaikawad --- src/validation_workflow/tar/validation_tar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/validation_workflow/tar/validation_tar.py b/src/validation_workflow/tar/validation_tar.py index d6e3c704cc..069151c071 100644 --- a/src/validation_workflow/tar/validation_tar.py +++ b/src/validation_workflow/tar/validation_tar.py @@ -49,14 +49,15 @@ def validation(self) -> bool: if self.check_cluster_readiness(): test_result, counter = ApiTestCases().test_apis(self.args.version, self.args.projects, self.check_for_security_plugin(os.path.join(self.tmp_dir.path, "opensearch")) if self.args.allow_http else True) - shutil.copy(os.path.join(self.tmp_dir.path, 'opensearch', 'logs', 'opensearch.log'), os.path.join('/tmp', 'opensearch.log')) if (test_result): logging.info(f'All tests Pass : {counter}') return True else: + shutil.copy(os.path.join(self.tmp_dir.path, 'opensearch', 'logs', 'opensearch.log'), os.path.join('/tmp', 'opensearch.log')) self.cleanup() raise Exception(f'Not all tests Pass : {counter}') else: + shutil.copy(os.path.join(self.tmp_dir.path, 'opensearch', 'logs', 'opensearch.log'), os.path.join('/tmp', 'opensearch.log')) self.cleanup() raise Exception("Cluster is not ready for API test")