From 80ebf91d772024b0cdf803e64c9934f70c223875 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Tue, 28 May 2024 12:05:43 +0200 Subject: [PATCH] Set own endpoint last --- IM/tosca/Tosca.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/IM/tosca/Tosca.py b/IM/tosca/Tosca.py index e3dcf6bd..1a01449c 100644 --- a/IM/tosca/Tosca.py +++ b/IM/tosca/Tosca.py @@ -468,13 +468,7 @@ def _get_node_endpoints(self, node, nodetemplates): """ Get all endpoint associated with a node """ endpoints = [] - # First add its own endpoints - node_caps = node.get_capabilities() - if node_caps: - if "endpoint" in node_caps and node_caps["endpoint"]: - endpoints.append(node_caps["endpoint"]) - - # Now other hosted nodes ones + # First add hosted nodes ones for other_node in nodetemplates: root_type = Tosca._get_root_parent_type(other_node).type compute = None @@ -489,6 +483,12 @@ def _get_node_endpoints(self, node, nodetemplates): if root_type == "tosca.capabilities.Endpoint": endpoints.append(cap) + # Then add its own endpoints + node_caps = node.get_capabilities() + if node_caps: + if "endpoint" in node_caps and node_caps["endpoint"]: + endpoints.append(node_caps["endpoint"]) + return endpoints def _add_node_nets(self, node, radl, system, nodetemplates):