From: Ross Brattain Date: Wed, 1 Mar 2017 00:33:50 +0000 (-0800) Subject: Bugfix: heat: don't json encode template X-Git-Tag: opnfv-5.0.RC1~551^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=b32ba069a8233da64db4554dc0ee0edb985b8d43;hp=f73a21485dc963073f4232f1b131e503f457f9c5;p=yardstick.git 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 --- 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()