当前位置: 首页>>代码示例>>Python>>正文


Python SimpleType.ifc2asa方法代码示例

本文整理汇总了Python中translator.base.simpletype.SimpleType.ifc2asa方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleType.ifc2asa方法的具体用法?Python SimpleType.ifc2asa怎么用?Python SimpleType.ifc2asa使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在translator.base.simpletype.SimpleType的用法示例。


在下文中一共展示了SimpleType.ifc2asa方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ifc2asa

# 需要导入模块: from translator.base.simpletype import SimpleType [as 别名]
# 或者: from translator.base.simpletype.SimpleType import ifc2asa [as 别名]
    def ifc2asa(self, no_asa_cfg_stack, asa_cfg_list, interfaces = None):
        '''Generate ASA configuration from IFC configuration delta.
        @see DMObject.ifc2asa for parameter details
        '''
        if not self.has_ifc_delta_cfg():
            return
        action = self.get_action()
        if action == State.NOCHANGE:
            return

        if action == State.DESTROY and self.is_removable:
            self.generate_cli(no_asa_cfg_stack, 'no ' + self.get_cli())
        else:
            self.generate_cli(asa_cfg_list, self.get_cli())
        # apply the pool to the management interface
        value = normalize_param_dict(self.delta_ifc_cfg_value['value'])
        intf = self.get_top().get_mgmt_interface()
        if not intf:
            # default management interface: m0/0
            intf = 'm0/0'
        attr = self.get_mgmt_intf_attributes(intf)
        if attr == None:
            return
        clii = CLIInteraction(mode_command='interface ' + util.normalize_interface_name(intf),
            command='ip address ' + attr['ip'] + ' ' + attr['mask'] + ' cluster-pool ' + value['pool_name'],
            response_parser=cluster_response_parser)
        asa_cfg_list.append(clii)
        SimpleType.ifc2asa(self, no_asa_cfg_stack, asa_cfg_list)
开发者ID:AlexFengCisco,项目名称:ACI_REST_Project,代码行数:30,代码来源:cluster.py

示例2: ifc2asa

# 需要导入模块: from translator.base.simpletype import SimpleType [as 别名]
# 或者: from translator.base.simpletype.SimpleType import ifc2asa [as 别名]
 def ifc2asa(self, no_asa_cfg_stack, asa_cfg_list):
     value = self.get_value_with_connector()
     'Prevent the deletion of route on management interface or IFC will not able to connect to the ASA'
     self.is_removable = value.get('interface') != 'management'
     return SimpleType.ifc2asa(self, no_asa_cfg_stack, asa_cfg_list)
开发者ID:AlexFengCisco,项目名称:ACI_REST_Project,代码行数:7,代码来源:static_route.py


注:本文中的translator.base.simpletype.SimpleType.ifc2asa方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。