From 884d5403bc647b13d17dbfc7f791ce451a3b4e6b Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Wed, 29 Jan 2014 10:00:32 +0000 Subject: [PATCH] Pass empty dict not None for empty environment The server rejects any request with a None environment, so pass an empty dict not None (we should probably also make the server more robust so it can cope with None, but this seems the quickest and most backwards compatible fix for now) Change-Id: I0c3e8cd14faf257528be2254070bc40821675431 Closes-Bug: #1273993 --- heatclient/common/template_utils.py | 2 +- heatclient/tests/test_template_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/heatclient/common/template_utils.py b/heatclient/common/template_utils.py index 7d077fa0..bd54c9de 100644 --- a/heatclient/common/template_utils.py +++ b/heatclient/common/template_utils.py @@ -88,7 +88,7 @@ def process_environment_and_files(env_path=None, template_path=None): env = {} if not env_path: - return files, None + return files, env env_url = normalise_file_path_to_url(env_path) env_base_url = base_url_for_url(env_url) diff --git a/heatclient/tests/test_template_utils.py b/heatclient/tests/test_template_utils.py index d66b5117..2b9b2ae3 100644 --- a/heatclient/tests/test_template_utils.py +++ b/heatclient/tests/test_template_utils.py @@ -163,7 +163,7 @@ class ShellEnvironmentTest(testtools.TestCase): def test_no_process_environment_and_files(self): files, env = template_utils.process_environment_and_files() - self.assertIsNone(env) + self.assertEqual({}, env) self.assertEqual({}, files) def test_global_files(self):