X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=sfa%2Fplanetlab%2Fplslices.py;h=703dac30bf9592f7964c1a468527c9140fa55666;hp=8f24792776bf5206f90bb1ca322cba6e1db69e4c;hb=a6d9810733f7d21fd43ba519dae5ccfcdc138095;hpb=0b02f81338d0a27c9a713427cd65443b58727f2f diff --git a/sfa/planetlab/plslices.py b/sfa/planetlab/plslices.py index 8f247927..703dac30 100644 --- a/sfa/planetlab/plslices.py +++ b/sfa/planetlab/plslices.py @@ -326,21 +326,23 @@ class PlSlices: for link in requested_links: # get the ip address of the first node in the link ifname1 = Xrn(link['interface1']['component_id']).get_leaf() - ifname_parts = ifname1.split(':') - node_raw = ifname_parts[0] - device = None - if len(ifname_parts) > 1: - device = ifname_parts[1] - node_id = int(node_raw.replace('node', '')) - node = nodes_dict[node_id] - if1 = interfaces_dict[node['interface_ids'][0]] - ipaddr = if1['ip'] - topo_rspec = VLink.get_topo_rspec(link, ipaddr) - # set topo_rspec tag - slice_tags.append({'name': 'topo_rspec', 'value': str([topo_rspec]), 'node_id': node_id}) - # set vini_topo tag - slice_tags.append({'name': 'vini_topo', 'value': 'manual', 'node_id': node_id}) - #self.driver.shell.AddSliceTag(slice['name'], 'topo_rspec', str([topo_rspec]), node_id) + + if ifname1: + ifname_parts = ifname1.split(':') + node_raw = ifname_parts[0] + device = None + if len(ifname_parts) > 1: + device = ifname_parts[1] + node_id = int(node_raw.replace('node', '')) + node = nodes_dict[node_id] + if1 = interfaces_dict[node['interface_ids'][0]] + ipaddr = if1['ip'] + topo_rspec = VLink.get_topo_rspec(link, ipaddr) + # set topo_rspec tag + slice_tags.append({'name': 'topo_rspec', 'value': str([topo_rspec]), 'node_id': node_id}) + # set vini_topo tag + slice_tags.append({'name': 'vini_topo', 'value': 'manual', 'node_id': node_id}) + #self.driver.shell.AddSliceTag(slice['name'], 'topo_rspec', str([topo_rspec]), node_id) self.verify_slice_attributes(slice, slice_tags, {'append': True}, admin=True)