diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-07-24 17:20:50 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-07-25 17:30:12 +0200 |
commit | f81b0443cf09c34cb1f2060094e3eb294b8fa192 (patch) | |
tree | da5c3b85a8fc3cd113ceae3a2f2a8b8c770954e9 /python/vyos/validate.py | |
parent | add7eaebe7b8ebd4e143eb939d3ba7871ead0502 (diff) | |
download | vyos-1x-f81b0443cf09c34cb1f2060094e3eb294b8fa192.tar.gz vyos-1x-f81b0443cf09c34cb1f2060094e3eb294b8fa192.zip |
bonding: ifconfig: T2653: move to get_config_dict()
The current VyOS CLI parser code written in Python contains a ton of duplicates
which I can also hold myself accountable for - or maybe mainly me - depends on
the angle of judge.
Diffstat (limited to 'python/vyos/validate.py')
-rw-r--r-- | python/vyos/validate.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py index a0620e4dd..ceeb6888a 100644 --- a/python/vyos/validate.py +++ b/python/vyos/validate.py @@ -279,7 +279,6 @@ def is_member(conf, interface, intftype=None): False -> interface type cannot have members """ ret_val = None - if intftype not in ['bonding', 'bridge', None]: raise ValueError(( f'unknown interface type "{intftype}" or it cannot ' @@ -292,9 +291,9 @@ def is_member(conf, interface, intftype=None): conf.set_level([]) for it in intftype: - base = 'interfaces ' + it + base = ['interfaces', it] for intf in conf.list_nodes(base): - memberintf = [base, intf, 'member', 'interface'] + memberintf = base + [intf, 'member', 'interface'] if xml.is_tag(memberintf): if interface in conf.list_nodes(memberintf): ret_val = intf |