Пример #1
0
    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
0
 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)
 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)