diff options
author | Christian Breunig <christian@breunig.cc> | 2023-10-19 20:09:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 20:09:50 +0200 |
commit | 66668aa3b5c64ac1ed9acf3100237309865d732a (patch) | |
tree | c641719f1e769e65a07f5c880078b3a6a48d09a5 /python/vyos | |
parent | 0dcddbd4594fa957a331c9e5ef752b035513bc12 (diff) | |
parent | 3f17de7c32621353b51f782ca889a83cad7a6cfd (diff) | |
download | vyos-1x-66668aa3b5c64ac1ed9acf3100237309865d732a.tar.gz vyos-1x-66668aa3b5c64ac1ed9acf3100237309865d732a.zip |
Merge pull request #2378 from c-po/bridge-t5670
bridge: T5670: add missing constraint on "member interface" node
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/configdict.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 71a06b625..075ffe466 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -258,10 +258,10 @@ def has_address_configured(conf, intf): old_level = conf.get_level() conf.set_level([]) - intfpath = 'interfaces ' + Section.get_config_path(intf) - if ( conf.exists(f'{intfpath} address') or - conf.exists(f'{intfpath} ipv6 address autoconf') or - conf.exists(f'{intfpath} ipv6 address eui64') ): + intfpath = ['interfaces', Section.get_config_path(intf)] + if (conf.exists([intfpath, 'address']) or + conf.exists([intfpath, 'ipv6', 'address', 'autoconf']) or + conf.exists([intfpath, 'ipv6', 'address', 'eui64'])): ret = True conf.set_level(old_level) @@ -279,8 +279,7 @@ def has_vrf_configured(conf, intf): old_level = conf.get_level() conf.set_level([]) - tmp = ['interfaces', Section.get_config_path(intf), 'vrf'] - if conf.exists(tmp): + if conf.exists(['interfaces', Section.get_config_path(intf), 'vrf']): ret = True conf.set_level(old_level) @@ -298,8 +297,7 @@ def has_vlan_subinterface_configured(conf, intf): ret = False intfpath = ['interfaces', Section.section(intf), intf] - if ( conf.exists(intfpath + ['vif']) or - conf.exists(intfpath + ['vif-s'])): + if (conf.exists(intfpath + ['vif']) or conf.exists(intfpath + ['vif-s'])): ret = True return ret |