X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fplc%2Fslices.py;h=342873c922e2935cfa25eca30e79125c1e3204a4;hb=3c7563cc3487b6f6557881503ed3fb4403a3ef05;hp=5edce6476a80e5a19e24fb58370dbbeb43e71045;hpb=8bc5092da0896f151bfc379c85f3aec84c9a106a;p=sfa.git diff --git a/sfa/plc/slices.py b/sfa/plc/slices.py index 5edce647..342873c9 100644 --- a/sfa/plc/slices.py +++ b/sfa/plc/slices.py @@ -6,6 +6,7 @@ from sfa.util.plxrn import hrn_to_pl_slicename from sfa.util.policy import Policy from sfa.rspecs.rspec import RSpec from sfa.plc.vlink import VLink +from sfa.util.xrn import Xrn MAXINT = 2L**31-1 @@ -183,12 +184,22 @@ class Slices: except: self.api.logger.log_exc('Failed to add/remove slice from nodes') - def verify_slice_links(self, slice, links, aggregate): + def verify_slice_links(self, links, aggregate): # nodes is undefined here - if not links or not aggregate.nodes: + if not links: return + for link in links: - topo_rspec = VLink.get_topo_rspec(link) + # get the ip address of the first node in the link + ifname1 = Xrn(link['interface1']).get_leaf() + (node, device) = ifname1.split(':') + node_id = int(node.replace('node', '')) + node = aggregate.nodes[node_id] + if1 = aggregate.interfaces[node['interface_ids'][0]] + ipaddr = if1['ip'] + topo_rspec = VLink.get_topo_rspec(link, ipaddr) + self.api.plshell.AddSliceTag(self.api.plauth, slice['name'], 'topo_rspec', topo_rspec, node_id) + def handle_peer(self, site, slice, persons, peer):