Custom definitions fail if parent definition has no properties
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
TOSCA Parser |
New
|
Undecided
|
Unassigned |
Bug Description
I have a problem with custom definitions when a parent definition doesn't have a properties field.
Custom definition file openstack-
-------
tosca_definitio
capability_types:
openstack.
derived_from: tosca.capabilit
openstack.
derived_from: openstack.
properties:
disk:
type: scalar-unit.size
required: false
ephemeral:
type: scalar-unit.size
default: 0 GiB
id:
type: string
required: false
is_public:
type: boolean
default: true
name:
type: string
required: true
ram:
type: scalar-unit.size
required: false
swap:
type: scalar-unit.size
default: 0 MiB
vcpus:
type: integer
required: false
node_types:
openstack.
derived_from: tosca.nodes.Root
properties:
extra_specs:
type: map
required: false
capabilities:
self:
type: openstack.
-------
Template file openstack-
-------
tosca_definitio
imports:
- openstack-
topology_template:
node_templates:
m1.small:
type: openstack.
capabilities:
self:
disk: 150 GiB
name: m1.small
ram: 2 GiB
vcpus: 1
-------
The command:
tosca-parser --template openstack-
Above command gets into error:
-------
Traceback (most recent call last):
File "/home/
sys.
File "/home/
ParserShell
File "/home/
self.
File "/home/
tosca = ToscaTemplate(path, None, a_file)
File "/home/
self.
File "/home/
None)
File "/home/
self.
File "/home/
tpl.
File "/home/
self.
File "/home/
self.
File "/home/
props[
File "/home/
for p in entitytype.
File "/home/
for prop, schema in props.items():
AttributeError: 'NoneType' object has no attribute 'items'
-------
Expected output:
version: tosca_simple_
nodetemplates:
m1.small