diff options
author | 2017-02-06 15:53:03 -0800 | |
---|---|---|
committer | 2017-02-06 15:53:03 -0800 | |
commit | 1d3f16e59458942b4112878d6020b6303296dcec (patch) | |
tree | 8c865d0b78f727b255f8d90c9953bc453fcc710d /lib/partitioner/partitioner.py | |
parent | 50d396311c07d0c193d7aa956d8704dfa2b2619d (diff) |
JIRA DOMINO-21
Change-Id: I374ec211ca86c50fa22c42f3c410e0d89cbc27ef
Signed-off-by: Ulas Kozat <ulas.kozat@gmail.com>
Diffstat (limited to 'lib/partitioner/partitioner.py')
-rw-r--r-- | lib/partitioner/partitioner.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/partitioner/partitioner.py b/lib/partitioner/partitioner.py index 75adc63..5188193 100644 --- a/lib/partitioner/partitioner.py +++ b/lib/partitioner/partitioner.py @@ -7,7 +7,7 @@ import constants import copy -def partition_tosca(filepath, nodesite, tpl): +def partition_tosca(filepath, nodesite, tpl, tpl_local={}): file_paths = {} #holds the list of partitioned files sitenodes = {} #holds nodes in each site @@ -20,7 +20,7 @@ def partition_tosca(filepath, nodesite, tpl): sitenodes[nodesite[node]] = [node] #prepare the nodes - tpl_local = {} + #tpl_local = {} for site in sitenodes: tpl_local[site] = copy.deepcopy(tpl) #remove the nodes not assigned to a site @@ -137,3 +137,19 @@ def rm_orphans(tpl): for node in list(nodes): if (nodes[node]['type'] == 'tosca.nodes.nfv.VL') and (node not in keep_list): del nodes[node] + +def return_boundarylinks(tpl_site): + VL = {} + sites_of_VL = {} + # First find all the VLs copied to each site + for site in tpl_site.keys(): + nodes = tpl_site[site]['topology_template']['node_templates'] + for node in nodes: + if (nodes[node]['type'] == 'tosca.nodes.nfv.VL'): + if sites_of_VL.has_key(node): #if true, then this VL maps to more than 1 site + sites_of_VL[node].add(site) + VL[node] = nodes[node] + else: + sites_of_VL[node] = set([site]) + + return VL, sites_of_VL |