aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--yardstick/orchestrator/heat.py2
-rw-r--r--yardstick/tests/unit/orchestrator/test_heat.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py
index 1a8beaeb6..754482e4f 100644
--- a/yardstick/orchestrator/heat.py
+++ b/yardstick/orchestrator/heat.py
@@ -53,7 +53,7 @@ class HeatStack(object):
def create(self, template, heat_parameters, wait, timeout):
"""Creates an OpenStack stack from a template"""
with tempfile.NamedTemporaryFile('wb', delete=False) as template_file:
- template_file.write(jsonutils.dumps(template))
+ template_file.write(jsonutils.dump_as_bytes(template))
template_file.close()
self._stack = self._cloud.create_stack(
self.name, template_file=template_file.name, wait=wait,
diff --git a/yardstick/tests/unit/orchestrator/test_heat.py b/yardstick/tests/unit/orchestrator/test_heat.py
index 9164197b8..f53c9b78c 100644
--- a/yardstick/tests/unit/orchestrator/test_heat.py
+++ b/yardstick/tests/unit/orchestrator/test_heat.py
@@ -59,7 +59,7 @@ class HeatStackTestCase(unittest.TestCase):
with mock.patch.object(tempfile._TemporaryFileWrapper, '__enter__',
return_value=mock_tfile):
self.heatstack.create(template, heat_parameters, True, 100)
- mock_tfile.write.assert_called_once_with(jsonutils.dumps(template))
+ mock_tfile.write.assert_called_once_with(jsonutils.dump_as_bytes(template))
mock_tfile.close.assert_called_once()
self.mock_stack_create.assert_called_once_with(