From 59d68e49a5830741a602aee0a6e7fa73d8eda776 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh <567675+ajkavanagh@users.noreply.github.com> Date: Thu, 23 Jul 2020 14:07:21 +0100 Subject: [PATCH] Ensure that the tests directory exists for the local cacert (#373) A recent change to allow multiple zazas to run at the same time fixed the cacert file into a local 'tests/' directory. Unfortunately, that doesn't exist for every environment where zaza runs (e.g. mojo) and so this patch ensures that the path exists prior to trying to download into it. --- zaza/openstack/utilities/openstack.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zaza/openstack/utilities/openstack.py b/zaza/openstack/utilities/openstack.py index 4424cea..14c708c 100644 --- a/zaza/openstack/utilities/openstack.py +++ b/zaza/openstack/utilities/openstack.py @@ -1737,6 +1737,15 @@ def get_overcloud_auth(address=None, model_name=None): } if tls_rid: unit = model.get_first_unit_name('keystone', model_name=model_name) + + # ensure that the path to put the local cacert in actually exists. The + # assumption that 'tests/' exists for, say, mojo is false. + # Needed due to: + # commit: 537473ad3addeaa3d1e4e2d0fd556aeaa4018eb2 + _dir = os.path.dirname(KEYSTONE_LOCAL_CACERT) + if not os.path.exists(_dir): + os.makedirs(_dir) + model.scp_from_unit( unit, KEYSTONE_REMOTE_CACERT,