X-Git-Url: http://git.onelab.eu/?p=nodemanager-topo.git;a=blobdiff_plain;f=create-topo-attributes.py;h=f0c95e2b461f2f6cf0b55d09db92aa56682f7830;hp=925b7217818469927f192b5688c61695f53cec2c;hb=8b07d3cdcc4cbe4eadc0a06175912666c9775d6d;hpb=efc048541e28a0c102a9ce7026754e3bc3d3e085 diff --git a/create-topo-attributes.py b/create-topo-attributes.py index 925b721..f0c95e2 100755 --- a/create-topo-attributes.py +++ b/create-topo-attributes.py @@ -116,6 +116,8 @@ class Slice: record = {'slice_tag_id':None, 'slice_id':self.id, 'tagname':tagname, 'value':value} if node: record['node_id'] = node.id + else: + record['node_id'] = None tag = Slicetag(record) slicetags[id] = tag self.slice_tag_ids.append(id) @@ -331,7 +333,14 @@ for i in slices: else: topo_type = None - if topo_type == 'vsys' or topo_type == 'iias': + """ + Valid values of topo_type: + 'vsys': Use vsys topology scripts to set up virtual links + 'iias': Automatically create a virtual topology mirroring the physical one + 'manual': Don't modify the topo_rspec tags if present + None: No virtual topology + """ + if topo_type in ['vsys', 'iias', 'manual']: slice.assign_egre_key(slicetags) slice.turn_on_netns(slicetags) slice.add_cap_net_admin(slicetags) @@ -368,6 +377,11 @@ for i in slices: if dryrun: print "Slice %s not using IIAS" % slice.name + if topo_type == 'manual' and slice.get_tag('egre_key', slicetags): + topo_tag = slice.get_tag('topo_rspec', slicetags) + if topo_tag: + topo_tag.updated = True + # Update the tag values in the database for i in slicetags: tag = slicetags[i]