From 9bfd6c21a7648e945576ce025ecc8e7733bee93c Mon Sep 17 00:00:00 2001 From: James Slagle Date: Wed, 8 Mar 2017 08:36:58 -0500 Subject: [PATCH] Use tmp env path when rewriting absolute resource paths When rewriting absolute resource paths from a resource_registry that failed to load due to missing resources (one case being where those resources are rendered j2), then we should refer to the initial environemnt that failed to load by the tmp path. This is required since itself may have been rendered from j2. In such a case, the environment doesn't exist under the absolute template root path as it's not been rendered to that location. Change-Id: Ib681729cc2728ca4b0486c14166b6b702edfcaab Closes-Bug: #1671096 --- tripleoclient/v1/overcloud_deploy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index 0f7589d6e..2cfd99a1a 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -149,7 +149,9 @@ class DeployOvercloud(command.Command): # for details on why this is needed (backwards-compatibility) self.log.debug("Error %s processing environment file %s" % (six.text_type(ex), env_path)) - with open(abs_env_path, 'r') as f: + # Use the temporary path as it's possible the environment + # itself was rendered via jinja. + with open(env_path, 'r') as f: env_map = yaml.safe_load(f) env_registry = env_map.get('resource_registry', {}) env_dirname = os.path.dirname(os.path.abspath(env_path))