summaryrefslogtreecommitdiff
path: root/heatclient/common
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2016-03-21 17:03:43 +0000
committerSteven Hardy <shardy@redhat.com>2016-03-21 17:07:49 +0000
commitf13d36ae0114e159663ea2a3fa07260df9d9407d (patch)
treebf5a9396c3702330123d3f18d3468d7040056287 /heatclient/common
parent641cde5ff44aea0ca51824a7c1499d34a4548a34 (diff)
downloadpython-heatclient-f13d36ae0114e159663ea2a3fa07260df9d9407d.tar.gz
Fix regression handling relative paths in environment
7627e1bae53747e1471caf632dfc1b6edf2e26cf introduced new code to add the environment to the files mapping, so server side resolution of multiple environments is possible. However, the environment added is wrong when you're handling those with relative paths inside, we must add the resolved version or the keys don't map to keys in the files map, an you get an error when we try to locate the file on the server. Evidently we lack adequate functional test coverage of this, which can be addressed via a heat patch, but I added a unit test illustrating the problem. Change-Id: I3bd2cd48623e4ad1b4067f4cefc7ddff30b9e88d Closes-Bug: #1560106
Diffstat (limited to 'heatclient/common')
-rw-r--r--heatclient/common/template_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/heatclient/common/template_utils.py b/heatclient/common/template_utils.py
index fae54ef..a1b176c 100644
--- a/heatclient/common/template_utils.py
+++ b/heatclient/common/template_utils.py
@@ -289,9 +289,6 @@ def process_environment_and_files(env_path=None,
env_base_url = utils.base_url_for_url(env_url)
raw_env = request.urlopen(env_url).read()
- if include_env_in_files:
- files[env_url] = raw_env
-
env = environment_format.parse(raw_env)
resolve_environment_urls(
@@ -299,6 +296,9 @@ def process_environment_and_files(env_path=None,
files,
env_base_url)
+ if include_env_in_files:
+ files[env_url] = jsonutils.dumps(env)
+
return files, env