summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py b/tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py
index 261d8ee..8994c63 100644
--- a/tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py
+++ b/tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py
@@ -357,9 +357,10 @@ class HotResource(object):
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:
@@ -377,9 +378,10 @@ class HotResource(object):
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():
@@ -396,8 +398,8 @@ class HotResource(object):
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)