EntityTemplate has no property of parent_type

Bug #1592831 reported by xiaodong shang
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TOSCA Parser
xiaodong shang

Bug Description

EntityTemplate is the parent of NodeTemplate,but there is no parent_type definition, so the method of is_derived_from may be error when judge one nodetemplate whether is a instance of grandparent node type, the current code logic in EntityTemplate class is below:

     def is_derived_from(self, type_str):
        '''Check if object inherits from the given type.

        Returns true if this object is derived from 'type_str'.
        False otherwise.
        if not self.type:
            return False
        elif self.type == type_str:
            return True
        elif self.parent_type: # Here may be error
            return self.parent_type.is_derived_from(type_str)
            return False

Changed in tosca-parser:
assignee: nobody → shangxdy (shangxdy)
Sahdev Zala (spzala)
Changed in tosca-parser:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.