From 89499f0614c1dbc13b99917a3ff67f28b36cb66c Mon Sep 17 00:00:00 2001 From: mrichomme Date: Wed, 2 Sep 2020 10:03:47 +0200 Subject: check_certificates: create result dir if needed an arg allows to specify the results dir but if the dir path is not valid, we got an error try to create the dir before running the test Issue-ID: INT-1570 Signed-off-by: mrichomme Change-Id: I32363af1f066dc5e5a0adf45619fb4e1a9052a7d Signed-off-by: mrichomme --- .../check_certificates/check_certificates_validity.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/security') diff --git a/test/security/check_certificates/check_certificates/check_certificates_validity.py b/test/security/check_certificates/check_certificates/check_certificates_validity.py index c38a7dc67..7447a64be 100644 --- a/test/security/check_certificates/check_certificates/check_certificates_validity.py +++ b/test/security/check_certificates/check_certificates/check_certificates_validity.py @@ -89,6 +89,10 @@ args = parser.parse_args() onap_namespace = args.namespace LOGGER.info("Verification of the %s certificates started", onap_namespace) +# Create the target dir (in case it does not exist) +if os.pardir not in args.dir: + os.makedirs(args.dir, exist_ok=True) + # Nodeport specific section # Retrieve the kubernetes IP for mode nodeport if args.mode == "nodeport": -- cgit 1.2.3-korg