diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-11-07 22:15:56 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-11-07 22:19:52 +0100 |
| commit | 24531dad6605c06c1a5c9f7efb4cdabb82f8cc45 (patch) | |
| tree | a532b2cdd8fa795855b0a8f26708a2fcc3b8ce6e /python | |
| parent | 504e08645611571f75cd373abb02be933aaa42b5 (diff) | |
| download | vyos-1x-24531dad6605c06c1a5c9f7efb4cdabb82f8cc45.tar.gz vyos-1x-24531dad6605c06c1a5c9f7efb4cdabb82f8cc45.zip | |
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.
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/configdict.py | 8 |
1 files changed, 4 insertions, 4 deletions
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']: |
