Skip to content

Commit

Permalink
Fix cloudformation NoValue parsing to not add attribute. Closes #870
Browse files Browse the repository at this point in the history
  • Loading branch information
spulec committed Mar 17, 2017
1 parent 042524f commit e3bff8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion moto/cloudformation/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ def clean_json(resource_json, resources_map):

cleaned_json = {}
for key, value in resource_json.items():
cleaned_json[key] = clean_json(value, resources_map)
cleaned_val = clean_json(value, resources_map)
if cleaned_val is None:
# If we didn't find anything, don't add this attribute
continue
cleaned_json[key] = cleaned_val
return cleaned_json
elif isinstance(resource_json, list):
return [clean_json(val, resources_map) for val in resource_json]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ def test_stack_elb_integration_with_update():
"Protocol": "HTTP",
}
],
"Policies": {"Ref" : "AWS::NoValue"},
}
},
},
Expand Down

0 comments on commit e3bff8b

Please sign in to comment.