Add parent interfaces to the list of NodeType interfaces
Change-Id: Ia957ad11985a3b6665f0015d17dacfd79a1a3d95 Closes-Bug: #1883563
This commit is contained in:
parent
b43f595fd3
commit
9f575be0ea
@ -169,7 +169,23 @@ class NodeType(StatefulEntityType):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def interfaces(self):
|
def interfaces(self):
|
||||||
return self.get_value(self.INTERFACES)
|
interfaces = self.get_value(self.INTERFACES)
|
||||||
|
|
||||||
|
if self.parent_type is not None:
|
||||||
|
if self.parent_type.interfaces is not None:
|
||||||
|
import copy
|
||||||
|
parent_interfaces = copy.deepcopy(self.parent_type.interfaces)
|
||||||
|
parent_interfaces.pop(ifaces.LIFECYCLE, None)
|
||||||
|
parent_interfaces.pop(ifaces.CONFIGURE, None)
|
||||||
|
parent_interfaces.pop(ifaces.LIFECYCLE_SHORTNAME, None)
|
||||||
|
parent_interfaces.pop(ifaces.CONFIGURE_SHORTNAME, None)
|
||||||
|
|
||||||
|
if parent_interfaces:
|
||||||
|
if interfaces:
|
||||||
|
parent_interfaces.update(interfaces)
|
||||||
|
interfaces = parent_interfaces
|
||||||
|
|
||||||
|
return interfaces
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lifecycle_inputs(self):
|
def lifecycle_inputs(self):
|
||||||
|
@ -264,16 +264,20 @@ class NodeTemplate(EntityTemplate):
|
|||||||
value, InterfacesDef.
|
value, InterfacesDef.
|
||||||
interfaces_relationship_configure_operations,
|
interfaces_relationship_configure_operations,
|
||||||
'interfaces')
|
'interfaces')
|
||||||
elif name in self.type_definition.interfaces.keys():
|
|
||||||
self._common_validate_field(
|
|
||||||
value,
|
|
||||||
self._collect_custom_iface_operations(name),
|
|
||||||
'interfaces')
|
|
||||||
else:
|
else:
|
||||||
ExceptionCollector.appendException(
|
interfaces = self.type_definition.interfaces
|
||||||
UnknownFieldError(
|
if interfaces is None:
|
||||||
what='"interfaces" of template "%s"' %
|
interfaces = dict()
|
||||||
self.name, field=name))
|
if name in interfaces.keys():
|
||||||
|
self._common_validate_field(
|
||||||
|
value,
|
||||||
|
self._collect_custom_iface_operations(name),
|
||||||
|
'interfaces')
|
||||||
|
else:
|
||||||
|
ExceptionCollector.appendException(
|
||||||
|
UnknownFieldError(
|
||||||
|
what='"interfaces" of template "%s"' %
|
||||||
|
self.name, field=name))
|
||||||
|
|
||||||
def _collect_custom_iface_operations(self, name):
|
def _collect_custom_iface_operations(self, name):
|
||||||
allowed_operations = []
|
allowed_operations = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user