本文整理匯總了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)
示例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)