diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-02-06 13:54:15 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-02-06 20:57:03 +0100 |
commit | 073bd082337272d846080fc86e56ed696287ba69 (patch) | |
tree | 8a9902c5891f8b8565f6313d3925c8ca0055af1e | |
parent | 8c8358f488ae5901d1c4ab52b422cf132c2dabe6 (diff) | |
download | vyos-1x-073bd082337272d846080fc86e56ed696287ba69.tar.gz vyos-1x-073bd082337272d846080fc86e56ed696287ba69.zip |
config: T4228: is_member() must return all instances not only the last one
(cherry picked from commit 5e7e96380b314587bbd8bd584848d39caef86f3f)
-rw-r--r-- | python/vyos/configdict.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index c78a95d97..486260152 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -196,7 +196,7 @@ def is_member(conf, interface, intftype=None): interface name -> Interface is a member of this interface False -> interface type cannot have members """ - ret_val = None + ret_val = {} intftypes = ['bonding', 'bridge'] if intftype not in intftypes + [None]: @@ -216,8 +216,8 @@ def is_member(conf, interface, intftype=None): member = base + [intf, 'member', 'interface', interface] if conf.exists(member): tmp = conf.get_config_dict(member, key_mangling=('-', '_'), - get_first_key=True) - ret_val = {intf : tmp} + get_first_key=True, no_tag_node_value_mangle=True) + ret_val.update({intf : tmp}) old_level = conf.set_level(old_level) return ret_val |