diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-07-22 23:36:44 +0100 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-07-22 23:36:44 +0100 |
commit | faaad2e029fd3520b62983dd78c7692434138360 (patch) | |
tree | 5780fae80500ff6be5bc5503487d4fd5f2a82e43 /python/vyos/validate.py | |
parent | da65aa2290e54f47dcc9c527723557fdbe2cb892 (diff) | |
download | vyos-1x-faaad2e029fd3520b62983dd78c7692434138360.tar.gz vyos-1x-faaad2e029fd3520b62983dd78c7692434138360.zip |
xml: T2582: use xml for is_tag and is_leaf
Diffstat (limited to 'python/vyos/validate.py')
-rw-r--r-- | python/vyos/validate.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py index 9072c5817..a0620e4dd 100644 --- a/python/vyos/validate.py +++ b/python/vyos/validate.py @@ -19,6 +19,7 @@ import netifaces import ipaddress from vyos.util import cmd +from vyos import xml # Important note when you are adding new validation functions: # @@ -293,12 +294,12 @@ def is_member(conf, interface, intftype=None): for it in intftype: base = 'interfaces ' + it for intf in conf.list_nodes(base): - memberintf = f'{base} {intf} member interface' - if conf.is_tag(memberintf): + memberintf = [base, intf, 'member', 'interface'] + if xml.is_tag(memberintf): if interface in conf.list_nodes(memberintf): ret_val = intf break - elif conf.is_leaf(memberintf): + elif xml.is_leaf(memberintf): if ( conf.exists(memberintf) and interface in conf.return_values(memberintf) ): ret_val = intf |