nodenetworks are now known as interfaces
[nodemanager.git] / plugins / omf_vref.py
1 #
2 # $Id$
3 # $URL$
4 #
5 # NodeManager plugin - first step of handling omf_controlled slices
6
7 """
8 Overwrites the 'vref' tag of slivers controlled by OMF so sm.py does the right thing
9 Needs to be done the 'sm' module kicks in
10 """
11
12 import logger
13
14 # do this early, before step 10
15 priority = 4
16
17 def start(options, conf):
18     logger.log("omf_vref: plugin starting up...")
19
20 def GetSlivers(data, conf = None, plc = None):
21     if 'accounts' not in data: 
22         logger.log_missing_data("omf_vref.GetSlivers",'accounts')
23         return
24
25     for sliver in data['slivers']:
26         name=sliver['name']
27         for chunk in sliver['attributes']:
28             if chunk['tagname']=='omf_control':
29                 sliver['vref']='omf'
30                 logger.log('omf_vref: %s now has vref==omf' % name)