node_type = node.type_definition
if isinstance(node_type, str) or \
- node_type.type == "tosca.policies.Placement" or \
- node_type.type == "tosca.policies.Colocate" or \
- node_type.type == "tosca.policies.Antilocate":
+ node_type.is_derived_from("tosca.policies.Root"):
+ # node_type.type == "tosca.policies.Placement" or \
+ # node_type.type == "tosca.policies.Placement.Colocate" or \
+ # node_type.type == "tosca.policies.Placement.Antilocate":
return operations
while True:
def _get_interface_operations_from_type(node_type, node, lifecycle_name):
operations = {}
if isinstance(node_type, str) or \
- node_type.type == "tosca.policies.Placement" or \
- node_type.type == "tosca.policies.Colocate" or \
- node_type.type == "tosca.policies.Antilocate":
+ node_type.is_derived_from("tosca.policies.Root"):
+ # node_type.type == "tosca.policies.Placement" or \
+ # node_type.type == "tosca.policies.Placement.Colocate" or \
+ # node_type.type == "tosca.policies.Placement.Antilocate":
return operations
if node_type.interfaces and lifecycle_name in node_type.interfaces:
for name, elems in node_type.interfaces[lifecycle_name].items():
def get_base_type(node_type):
if node_type.parent_type is not None:
if node_type.parent_type.type.endswith('.Root') or \
- node_type.type == "tosca.policies.Colocate" or \
- node_type.type == "tosca.policies.Antilocate":
+ node_type.type == "tosca.policies.Placement.Colocate" or \
+ node_type.type == "tosca.policies.Placement.Antilocate":
return node_type
else:
return HotResource.get_base_type(node_type.parent_type)