本文整理汇总了Python中base.simpletype.SimpleType类的典型用法代码示例。如果您正苦于以下问题:Python SimpleType类的具体用法?Python SimpleType怎么用?Python SimpleType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SimpleType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_cli
def generate_cli(self, asa_cfg_list, cli):
"""
Override the default implementation to make the modify and delete CLI idempotent.
That is issuing the CLI multiple times result in the same behavior in the running-config
without the need to report error.
"""
SimpleType.generate_cli(self, asa_cfg_list, cli, response_parser = idempotent_response_parser)
示例2: __init__
def __init__(self, name):
SimpleType.__init__(self, name,
asa_gen_template='object-group network %(name)s');
self.register_child(Description())
self.register_child(DMList(name='host_ip_address', child_class = HostObject, asa_key = 'network-object host'))
self.register_child(DMList(name='object_name', child_class = ObjectObject, asa_key = 'network-object object'))
self.register_child(DMList(name='network_ip_address', child_class = NetworkObject, asa_key = 'network-object'))
self.register_child(DMList(name='object_group_name', child_class = GroupObject, asa_key = 'group-object'))
示例3: parse_multi_parameter_cli
def parse_multi_parameter_cli(self, cli):
'''Override the default implementation in case the CLI does not match asa_gen_template due to optional
parameter
'''
result = SimpleType.parse_multi_parameter_cli(self, cli)
if not result:
result = SimpleType.parse_multi_parameter_cli(self, cli,
alternate_asa_gen_template = ' '.join(self.asa_gen_template.split()[:3]))
return result
示例4: ifc2asa
def ifc2asa(self, no_asa_cfg_stack, asa_cfg_list):
'''Override the default implementation for modify action:
Need to issue no command to delete old one and then issue command to set the new one.
'''
if self.get_action() == State.MODIFY:
old_cli = self.get_old_cli()
if old_cli:
self.generate_cli(no_asa_cfg_stack, 'no ' + old_cli)
SimpleType.ifc2asa(self, no_asa_cfg_stack, asa_cfg_list)
示例5: __init__
def __init__(self, name):
SimpleType.__init__(self, name,
asa_gen_template='interface BVI%(bvi_id)s');
self.register_child(IPv4Addr('ipv4_address'))
self.register_child(DMList(name='ipv6_address_with_prefix', child_class=IPv6Addr, asa_key ='ipv6 address'))
self.register_child(IPv6Enable('ipv6_enable'))
self.register_child(IPv6NDDad('ipv6_nd_dad_attempts'))
self.register_child(IPv6NDNsInterval('ipv6_nd_ns_interval'))
self.register_child(IPv6NDReachable('ipv6_nd_reachable_time'))
self.member1 = BridgeGroupMember()
self.member2 = BridgeGroupMember()
self.response_parser = cli_interaction.ignore_info_response_parser
示例6: __init__
def __init__(self, name):
SimpleType.__init__(self, name,
asa_gen_template='interface TVI1'); # Phase 1 only has TVI1
self.register_child(IPv4Addr('ipv4_address'))
self.register_child(DMList(name='ipv6_address_with_prefix', child_class=IPv6Addr, asa_key ='ipv6 address'))
self.register_child(IPv6Enable('ipv6_enable'))
self.register_child(IPv6NDDad('ipv6_nd_dad_attempts'))
self.register_child(IPv6NDNsInterval('ipv6_nd_ns_interval'))
self.register_child(IPv6NDReachable('ipv6_nd_reachable_time'))
self.register_child(MACAddr('mac-address'))
self.register_child(NameIF('nameif'))
self.response_parser = cli_interaction.ignore_info_response_parser