本文整理汇总了Python中dm_utils.DMUtils.lacp_system_priority方法的典型用法代码示例。如果您正苦于以下问题:Python DMUtils.lacp_system_priority方法的具体用法?Python DMUtils.lacp_system_priority怎么用?Python DMUtils.lacp_system_priority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dm_utils.DMUtils
的用法示例。
在下文中一共展示了DMUtils.lacp_system_priority方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_ae_config
# 需要导入模块: from dm_utils import DMUtils [as 别名]
# 或者: from dm_utils.DMUtils import lacp_system_priority [as 别名]
def build_ae_config(self, esi_map):
if esi_map:
self.set_chassis_config()
interfaces_config = self.interfaces_config or \
Interfaces(comment=DMUtils.interfaces_comment())
# self.ae_id_map should have all esi => ae_id mapping
# esi_map should have esi => interface memberships
for esi, ae_id in self.physical_router.ae_id_map.items():
# config ae interface
ae_name = "ae" + str(ae_id)
intf = Interface(name=ae_name)
interfaces_config.add_interface(intf)
priority = DMUtils.lacp_system_priority()
system_id = esi[-17:] #last 17 charcaters from esi for ex: 00:00:00:00:00:05
lacp = Lacp(active='', system_priority=priority, \
system_id=system_id, admin_key=1)
intf.set_aggregated_ether_options(AggregatedEtherOptions(lacp=lacp))
# associate 'ae' membership
pi_list = esi_map.get(esi)
for pi in pi_list or []:
intf = Interface(name=pi.name)
interfaces_config.add_interface(intf)
etherOptions = EtherOptions(ieee_802_3ad=Ieee802(bundle=ae_name))
intf.set_gigether_options(etherOptions)
self.interfaces_config = interfaces_config