From b32ba069a8233da64db4554dc0ee0edb985b8d43 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Tue, 28 Feb 2017 16:33:50 -0800 Subject: [PATCH] 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 --- yardstick/orchestrator/heat.py | 5 +---- 1 file changed, 1 insertion(+), 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() -- 2.16.6