summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-02-28 16:33:50 -0800
committerRoss Brattain <ross.b.brattain@intel.com>2017-03-10 01:39:11 +0000
commitb32ba069a8233da64db4554dc0ee0edb985b8d43 (patch)
tree4a932bf14188c5970385ac47175535e405812052
parentf73a21485dc963073f4232f1b131e503f457f9c5 (diff)
Bugfix: heat: don't json encode template
heatclient.common.http.SessionClient automatically json.dumps the data in kwargs. If we json dump ourselves we end up double-decoding which is invalid. heatclient.common.http.py: class SessionClient(adapter.LegacyJsonAdapter): """HTTP client based on Keystone client session.""" def request(self, url, method, **kwargs): redirect = kwargs.get('redirect') kwargs.setdefault('user_agent', USER_AGENT) if 'data' in kwargs: kwargs['data'] = jsonutils.dumps(kwargs['data']) kwargs['data'] includes the template, so this is double-decoding in JSON JIRA: YARDSTICK-584 Change-Id: I663af42f7e92e285b540b614ceda87f17da5f22d Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
-rw-r--r--yardstick/orchestrator/heat.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py
index 500776e0e..49126f661 100644
--- a/yardstick/orchestrator/heat.py
+++ b/yardstick/orchestrator/heat.py
@@ -21,7 +21,6 @@ import time
import heatclient
import pkg_resources
-from oslo_serialization import jsonutils
from oslo_utils import encodeutils
import yardstick.common.openstack_utils as op_utils
@@ -453,11 +452,9 @@ class HeatTemplate(HeatObject):
stack = HeatStack(self.name)
heat = self._get_heat_client()
- json_template = jsonutils.dump_as_bytes(
- self._template)
start_time = time.time()
stack.uuid = self.uuid = heat.stacks.create(
- stack_name=self.name, template=json_template,
+ stack_name=self.name, template=self._template,
parameters=self.heat_parameters)['stack']['id']
status = self.status()