tosca parser should catch and report malformed property definitions and declarations
The tosca parser should have a generic exception handler that catches and reports malformed property definitions and declarations instead of throwing an uncaught exception in these two functions in toscaparser/entity_template.py:
- _common_validate_properties()
- _create_properties()
E.g. a missing "type" key currently throws an error like this:
File "/Users/adam/_dev/unfurl/unfurl/vendor/toscaparser/entity_template.py", line 90, in __init__
for prop in self.get_properties_objects():
File "/Users/adam/_dev/unfurl/unfurl/vendor/toscaparser/entity_template.py", line 128, in get_properties_objects
self._properties = self._create_properties()
File "/Users/adam/_dev/unfurl/unfurl/vendor/toscaparser/entity_template.py", line 334, in _create_properties
prop = Property(p.name, p.default, p.schema, self.custom_def)
File "/Users/adam/_dev/unfurl/unfurl/vendor/toscaparser/properties.py", line 37, in __init__
self.entity = DataEntity(schema_dict['type'], self.value, self.custom_def, self.name)
File "/Users/adam/.unfurl_home/.venv/lib/python3.8/site-packages/ruamel/yaml/comments.py", line 753, in __getitem__
return ordereddict.__getitem__(self, key)
KeyError: 'type'