From: mrichomme Date: Wed, 2 Sep 2020 08:03:47 +0000 (+0200) Subject: check_certificates: create result dir if needed X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=89499f0614c1dbc13b99917a3ff67f28b36cb66c;p=integration.git 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 --- 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":