From 24531dad6605c06c1a5c9f7efb4cdabb82f8cc45 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 7 Nov 2026 22:15:56 +0100 Subject: wwan: T9388: tidy up reading the default route options Import default_value() at module level instead of once per WWAN interface, and share the dhcp-options path of both route options so the lines stay within the line length. No functional change. --- python/vyos/configdict.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'python') diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 0a94cb84f..a623e419b 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -24,6 +24,7 @@ from vyos.config import ConfigDict from vyos.utils.dict import dict_search from vyos.utils.process import cmdl from vyos.utils.wwan import bearer_families +from vyos.xml_ref import default_value def retrieve_config(path_hash, base_path, config): """ @@ -502,13 +503,12 @@ def get_wwan_interfaces(conf, vrf=None): # get_interface_dict() drops dhcp_options unless "address dhcp" is # configured, but both options apply to the IPv6 route as well - from vyos.xml_ref import default_value - - path = ['interfaces', 'wwan', ifname, 'dhcp-options', 'default-route-distance'] + dhcp_options = ['interfaces', 'wwan', ifname, 'dhcp-options'] + path = dhcp_options + ['default-route-distance'] tmp = conf.return_value(path) if conf.exists(path) else default_value(path) if tmp is not None: options.update({'default_route_distance': tmp}) - if conf.exists(['interfaces', 'wwan', ifname, 'dhcp-options', 'no-default-route']): + if conf.exists(dhcp_options + ['no-default-route']): options.update({'no_default_route': {}}) if 'vrf' in ifconfig: if vrf == ifconfig['vrf']: -- cgit v1.2.3