From: Steve Baker Date: Tue, 9 Jul 2013 04:01:58 +0000 (+1200) Subject: Tolerate an empty environment properties. X-Git-Tag: 2014.1~381^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=27092a8b7b523e524c53bfd4790412a8cb3013ce;p=openstack-build%2Fheat-build.git Tolerate an empty environment properties. An environment file containing the following: properties: Results in the following error: File "/home/steveb/dev/localstack/heat/heat/api/openstack/v1/stacks.py", line 132, in environment env[self.PARAM_USER_PARAMS].update(parameters) AttributeError: 'NoneType' object has no attribute 'update' Change-Id: I7b36d797383cc3c74d4d0c77c283564b01aa6a6b --- diff --git a/heat/api/openstack/v1/stacks.py b/heat/api/openstack/v1/stacks.py index 97d254e7..3410ce4b 100644 --- a/heat/api/openstack/v1/stacks.py +++ b/heat/api/openstack/v1/stacks.py @@ -125,7 +125,7 @@ class InstantiationData(object): reason = _("%s not in valid in the environment") % field raise exc.HTTPBadRequest(reason) - if self.PARAM_USER_PARAMS not in env: + if not env.get(self.PARAM_USER_PARAMS): env[self.PARAM_USER_PARAMS] = {} parameters = self.data.get(self.PARAM_USER_PARAMS, {})