def prepare_groups(self, is_delete=False):
     groups = Groups()
     if is_delete:
         return groups
     groups.set_comment(DMUtils.groups_comment())
     groups.set_routing_instances(self.ri_config)
     groups.set_interfaces(self.interfaces_config)
     groups.set_services(self.services_config)
     groups.set_policy_options(self.policy_config)
     groups.set_firewall(self.firewall_config)
     groups.set_forwarding_options(self.forwarding_options_config)
     groups.set_routing_options(self.global_routing_options_config)
     groups.set_protocols(self.proto_config)
     self.add_product_specific_config(groups)
     return groups
Example #2
0
 def prepare_groups(self, is_delete=False):
     groups = Groups()
     if is_delete:
         return groups
     groups.set_comment(DMUtils.groups_comment())
     groups.set_routing_instances(self.ri_config)
     groups.set_interfaces(self.interfaces_config)
     groups.set_services(self.services_config)
     groups.set_policy_options(self.policy_config)
     groups.set_firewall(self.firewall_config)
     groups.set_forwarding_options(self.forwarding_options_config)
     groups.set_routing_options(self.global_routing_options_config)
     groups.set_protocols(self.proto_config)
     self.add_product_specific_config(groups)
     return groups
Example #3
0
    def send_bgp_config(self):
        if not self.set_bgp_group_config():
            return 0

        self.set_as_config()
        self.set_route_targets_config()

        groups = Groups()
        groups.set_comment(DMUtils.groups_comment())
        groups.set_routing_instances(self.ri_config)
        groups.set_interfaces(self.interfaces_config)
        groups.set_services(self.services_config)
        groups.set_policy_options(self.policy_config)
        groups.set_firewall(self.firewall_config)
        groups.set_forwarding_options(self.forwarding_options_config)
        groups.set_routing_options(self.global_routing_options_config)
        groups.set_protocols(self.proto_config)
        return self.send_netconf(groups)
    def prepare_conf(self, is_delete=False):
        device = Device()
        device.set_comment(DMUtils.groups_comment())
        device.set_system(self.system_config)
        if is_delete:
            return device

        device.set_evpn(self.evpn)
        device.set_bgp(self.get_values_sorted_by_key(self.bgp_map))

        pis = []
        for pi, li_map in self.get_values_sorted_by_key(self.pi_map):
            pi.set_logical_interfaces(self.get_values_sorted_by_key(li_map))
            pis.append(pi)

        device.set_physical_interfaces(pis)
        device.set_routing_instances(self.get_values_sorted_by_key(self.ri_map))
        device.set_vlans(self.get_values_sorted_by_key(self.vlan_map))
        device.set_firewall(self.firewall_config)
        return device
Example #5
0
    def prepare_conf(self, is_delete=False):
        device = Device()
        device.set_comment(DMUtils.groups_comment())
        device.set_system(self.system_config)
        if is_delete:
            return device

        device.set_evpn(self.evpn)
        device.set_bgp(self.get_values_sorted_by_key(self.bgp_map))

        pis = []
        for pi, li_map in self.get_values_sorted_by_key(self.pi_map):
            pi.set_logical_interfaces(self.get_values_sorted_by_key(li_map))
            pis.append(pi)

        device.set_physical_interfaces(pis)
        device.set_routing_instances(self.get_values_sorted_by_key(
            self.ri_map))
        device.set_vlans(self.get_values_sorted_by_key(self.vlan_map))
        device.set_firewall(self.firewall_config)
        return device