From 20637281b59014c3021637d85c04aa070a35472c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mar=C3=ADa=20Fern=C3=A1ndez?= Date: Tue, 29 Aug 2023 20:04:24 +0200 Subject: [PATCH] Give an early error about inaccessible security context files, instead of silently ignore it. --- wfexs_backend/workflow.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/wfexs_backend/workflow.py b/wfexs_backend/workflow.py index 25d06f28..ad9be659 100644 --- a/wfexs_backend/workflow.py +++ b/wfexs_backend/workflow.py @@ -1034,10 +1034,15 @@ def FromFiles( ) # Last, try loading the security contexts credentials file - if securityContextsConfigFilename and os.path.exists( - securityContextsConfigFilename - ): - creds_config = cls.ReadSecurityContextFile(securityContextsConfigFilename) + if securityContextsConfigFilename: + if os.path.exists(securityContextsConfigFilename): + creds_config = cls.ReadSecurityContextFile( + securityContextsConfigFilename + ) + else: + raise WFException( + f"Security context file {securityContextsConfigFilename} is not reachable" + ) else: creds_config = {}