def change_bucket_weight(self, req, **kwargs):
'''
Changes bucket weight for a datapath's GROUP
Rules are passed in this format port,weight; :
Example : '1,1;2,1;3,2;4,2'
'''
multipath_controller = self.mp_instance
try:
dp_id = kwargs['dp_id']
group_id = kwargs['group_id']
arg_rules = kwargs['rules']
rules = {}
for i in arg_rules.split(';'):
rules[int(i.split(',')[0])] = int(i.split(',')[1])
multipath_controller.topo_shape.modify_group(
multipath_controller.topo_shape.dpid_to_switch[
int(dp_id)].dp, int(group_id), rules)
except:
traceback.print_exc()
return Response(content_type='text/html', body='Done!\n')
mpsdn_controller.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录