Skip to content

Commit

Permalink
frrender: T6746: move get_frrender_dict from vyos.configdict to this …
Browse files Browse the repository at this point in the history
…module

Keep all FRRender stuff in one place.
  • Loading branch information
c-po committed Dec 18, 2024
1 parent 75de2fa commit 77628e4
Show file tree
Hide file tree
Showing 25 changed files with 507 additions and 505 deletions.
482 changes: 0 additions & 482 deletions python/vyos/configdict.py

Large diffs are not rendered by default.

484 changes: 484 additions & 0 deletions python/vyos/frrender.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/conf_mode/interfaces_bonding.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configdict import get_interface_dict
from vyos.configdict import is_node_changed
from vyos.configdict import leaf_node_changed
Expand All @@ -32,6 +31,7 @@
from vyos.configverify import verify_vlan_config
from vyos.configverify import verify_vrf
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.ifconfig import BondIf
from vyos.ifconfig.ethernet import EthernetIf
from vyos.ifconfig import Section
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/interfaces_ethernet.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

from vyos.base import Warning
from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configdict import get_interface_dict
from vyos.configdict import is_node_changed
from vyos.configverify import verify_address
Expand All @@ -35,6 +34,7 @@
from vyos.configverify import verify_eapol
from vyos.ethtool import Ethtool
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.ifconfig import EthernetIf
from vyos.ifconfig import BondIf
from vyos.utils.dict import dict_search
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.frrender import FRRender
from vyos.frrender import frr_protocols
from vyos.frrender import get_frrender_dict
from vyos.utils.dict import dict_search
from vyos.utils.process import is_systemd_service_running
from vyos import ConfigError
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_babel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_access_list
from vyos.configverify import verify_prefix_list
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.utils.dict import dict_search
from vyos.utils.process import is_systemd_service_running
from vyos import ConfigError
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_bfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import verify_vrf
from vyos.configverify import has_frr_protocol_in_dict
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.template import is_ipv6
from vyos.utils.network import is_ipv6_link_local
from vyos.utils.process import is_systemd_service_running
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

from vyos.base import Warning
from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_prefix_list
from vyos.configverify import verify_route_map
from vyos.configverify import verify_vrf
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.template import is_ip
from vyos.template import is_interface
from vyos.utils.dict import dict_search
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_eigrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
from sys import argv

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_vrf
from vyos.utils.process import is_systemd_service_running
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos import ConfigError
from vyos import airbag
airbag.enable()
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_isis.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
from sys import argv

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_common_route_maps
from vyos.configverify import verify_interface_exists
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.ifconfig import Interface
from vyos.utils.dict import dict_search
from vyos.utils.network import get_interface_config
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_mpls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

from glob import glob
from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.utils.dict import dict_search
from vyos.utils.file import read_file
from vyos.utils.process import is_systemd_service_running
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_openfabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

from vyos.base import Warning
from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import verify_interface_exists
from vyos.configverify import has_frr_protocol_in_dict
from vyos.utils.process import is_systemd_service_running
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos import ConfigError
from vyos import airbag
airbag.enable()
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_ospf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
from sys import argv

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import verify_common_route_maps
from vyos.configverify import verify_route_map
from vyos.configverify import verify_interface_exists
from vyos.configverify import verify_access_list
from vyos.configverify import has_frr_protocol_in_dict
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.utils.dict import dict_search
from vyos.utils.network import get_interface_config
from vyos.utils.process import is_systemd_service_running
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_ospfv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
from sys import argv

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import verify_common_route_maps
from vyos.configverify import verify_route_map
from vyos.configverify import verify_interface_exists
from vyos.configverify import has_frr_protocol_in_dict
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.ifconfig import Interface
from vyos.utils.dict import dict_search
from vyos.utils.network import get_interface_config
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_pim.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import verify_interface_exists
from vyos.configverify import has_frr_protocol_in_dict
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.frrender import pim_daemon
from vyos.utils.process import is_systemd_service_running
from vyos.utils.process import process_named_running
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_pim6.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_interface_exists
from vyos.utils.process import is_systemd_service_running
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos import ConfigError
from vyos import airbag
airbag.enable()
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_rip.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_common_route_maps
from vyos.configverify import verify_access_list
from vyos.configverify import verify_prefix_list
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.utils.dict import dict_search
from vyos.utils.process import is_systemd_service_running
from vyos import ConfigError
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_ripng.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_common_route_maps
from vyos.configverify import verify_access_list
from vyos.configverify import verify_prefix_list
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.utils.dict import dict_search
from vyos.utils.process import is_systemd_service_running
from vyos import ConfigError
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_rpki.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.pki import wrap_openssh_public_key
from vyos.pki import wrap_openssh_private_key
from vyos.utils.dict import dict_search_args
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_segment-routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from sys import exit

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configdict import list_diff
from vyos.configverify import has_frr_protocol_in_dict
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.ifconfig import Section
from vyos.utils.dict import dict_search
from vyos.utils.process import is_systemd_service_running
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/protocols_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
from sys import argv

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_common_route_maps
from vyos.configverify import verify_vrf
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.utils.process import is_systemd_service_running
from vyos.template import render
from vyos import ConfigError
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/system_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
from vyos.config import Config
from vyos.configdep import set_dependents
from vyos.configdep import call_dependents
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_route_map
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.utils.dict import dict_search
from vyos.utils.process import is_systemd_service_active
from vyos.utils.process import is_systemd_service_running
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/system_ipv6.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
from vyos.config import Config
from vyos.configdep import set_dependents
from vyos.configdep import call_dependents
from vyos.configdict import get_frrender_dict
from vyos.configverify import has_frr_protocol_in_dict
from vyos.configverify import verify_route_map
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.utils.dict import dict_search
from vyos.utils.file import write_file
from vyos.utils.process import is_systemd_service_active
Expand Down
2 changes: 1 addition & 1 deletion src/conf_mode/vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
from json import loads

from vyos.config import Config
from vyos.configdict import get_frrender_dict
from vyos.configdict import node_changed
from vyos.configverify import verify_route_map
from vyos.firewall import conntrack_required
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.ifconfig import Interface
from vyos.template import render
from vyos.utils.dict import dict_search
Expand Down
2 changes: 1 addition & 1 deletion src/services/vyos-configd
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ import zmq

from vyos.defaults import directories
from vyos.utils.boot import boot_configuration_complete
from vyos.configdict import get_frrender_dict
from vyos.configsource import ConfigSourceString
from vyos.configsource import ConfigSourceError
from vyos.configdiff import get_commit_scripts
from vyos.config import Config
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos import ConfigError

CFG_GROUP = 'vyattacfg'
Expand Down

0 comments on commit 77628e4

Please sign in to comment.