diff options
author | John Estabrook <jestabro@vyos.io> | 2020-07-22 19:36:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-22 19:36:05 -0500 |
commit | 2c33099f8be42f8a1cb89d8b925377507c34c516 (patch) | |
tree | 5780fae80500ff6be5bc5503487d4fd5f2a82e43 /python/vyos/validate.py | |
parent | da65aa2290e54f47dcc9c527723557fdbe2cb892 (diff) | |
parent | faaad2e029fd3520b62983dd78c7692434138360 (diff) | |
download | vyos-1x-2c33099f8be42f8a1cb89d8b925377507c34c516.tar.gz vyos-1x-2c33099f8be42f8a1cb89d8b925377507c34c516.zip |
Merge pull request #481 from thomas-mangin/T2582
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 |