]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Tolerate an empty environment properties.
authorSteve Baker <sbaker@redhat.com>
Tue, 9 Jul 2013 04:01:58 +0000 (16:01 +1200)
committerSteve Baker <sbaker@redhat.com>
Tue, 9 Jul 2013 22:24:57 +0000 (10:24 +1200)
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

heat/api/openstack/v1/stacks.py

index 97d254e796a17a35a9fc18bf94d01cfec63b9c9d..3410ce4b11581f129308361ce08ae581560f41e8 100644 (file)
@@ -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, {})