elijahchancey/pretty_cloudformation

Cloudformation Conditions causes pretty_cloudformation to break

Closed this issue · 1 comments

Running this file through pretty_cloudformation causes the parser to break:
https://github.com/elijahchancey/pretty_cloudformation/blob/master/examples/doesnt_work/before.yml

$ pretty_cloudformation.py examples/doesnt_work/before.yml
Traceback (most recent call last):
  File "/Users/elijahchancey/git/elijahchancey/pretty_cloudformation/pretty_cloudformation.py", line 44, in <module>
    data = yaml.safe_load(data)
  File "/usr/local/lib/python3.6/site-packages/yaml/__init__.py", line 94, in safe_load
    return load(stream, SafeLoader)
  File "/usr/local/lib/python3.6/site-packages/yaml/__init__.py", line 72, in load
    return loader.get_single_data()
  File "/usr/local/lib/python3.6/site-packages/yaml/constructor.py", line 37, in get_single_data
    return self.construct_document(node)
  File "/usr/local/lib/python3.6/site-packages/yaml/constructor.py", line 46, in construct_document
    for dummy in generator:
  File "/usr/local/lib/python3.6/site-packages/yaml/constructor.py", line 398, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/usr/local/lib/python3.6/site-packages/yaml/constructor.py", line 204, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File "/usr/local/lib/python3.6/site-packages/yaml/constructor.py", line 129, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/usr/local/lib/python3.6/site-packages/yaml/constructor.py", line 88, in construct_object
    data = constructor(self, tag_suffix, node)
  File "/Users/elijahchancey/git/elijahchancey/pretty_cloudformation/pretty_cloudformation.py", line 33, in default_constructor
    raise NotImplementedError('Node: ' + str(type(node)))
NotImplementedError: Node: <class 'yaml.nodes.SequenceNode'>

Fix the parser so the template is correctly parsed.

Done.