summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-02-06 13:54:15 +0100
committerChristian Poessinger <christian@poessinger.com>2022-02-06 13:54:15 +0100
commit5e7e96380b314587bbd8bd584848d39caef86f3f (patch)
treec16cf93657a154af7e9d70bfd93efc7c01b01156 /python
parent11a900e706db59459314622050ced7d4117f090b (diff)
downloadvyos-1x-5e7e96380b314587bbd8bd584848d39caef86f3f.tar.gz
vyos-1x-5e7e96380b314587bbd8bd584848d39caef86f3f.zip
config: T4228: is_member() must return all instances not only the last one
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configdict.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index d974a7565..e7f515ea9 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