本文整理汇总了Python中dm_utils.DMUtils.get_switch_vrf_import方法的典型用法代码示例。如果您正苦于以下问题:Python DMUtils.get_switch_vrf_import方法的具体用法?Python DMUtils.get_switch_vrf_import怎么用?Python DMUtils.get_switch_vrf_import使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dm_utils.DMUtils
的用法示例。
在下文中一共展示了DMUtils.get_switch_vrf_import方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_global_switch_opts
# 需要导入模块: from dm_utils import DMUtils [as 别名]
# 或者: from dm_utils.DMUtils import get_switch_vrf_import [as 别名]
def init_global_switch_opts(self):
if self.global_switch_options_config is None:
self.global_switch_options_config = SwitchOptions(comment=DMUtils.switch_options_comment())
self.global_switch_options_config.set_vtep_source_interface("lo0.0")
if not self.routing_instances:
# no vn config then no need to configure vrf target
return
self.global_switch_options_config.add_vrf_target(VniTarget(auto=''))
switch_options_community = DMUtils.get_switch_vrf_import(self.get_asn())
self.global_switch_options_config.add_vrf_target(VniTarget(community=switch_options_community))
示例2: set_route_targets_config
# 需要导入模块: from dm_utils import DMUtils [as 别名]
# 或者: from dm_utils.DMUtils import get_switch_vrf_import [as 别名]
def set_route_targets_config(self):
if self.policy_config is None:
self.policy_config = PolicyOptions(comment=DMUtils.policy_options_comment())
for route_target in self.route_targets:
comm = CommunityType(name=DMUtils.make_community_name(route_target),
members=route_target)
self.policy_config.add_community(comm)
# add community for switch options
comm = CommunityType(name=DMUtils.get_switch_policy_name(),
members=DMUtils.get_switch_vrf_import(self.get_asn()))
self.policy_config.add_community(comm)