summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-14 20:14:53 +0200
committerChristian Poessinger <christian@poessinger.com>2022-07-15 07:10:29 +0200
commit5b4f76429989a6ab8ca64aeed5a1fae09fe7c6ca (patch)
tree749c6880d346f4b01276ddb3c68910bfef174be6 /python
parent87d2dff241d9ab4de9f3a2c7fbf9852934557aef (diff)
downloadvyos-1x-5b4f76429989a6ab8ca64aeed5a1fae09fe7c6ca.tar.gz
vyos-1x-5b4f76429989a6ab8ca64aeed5a1fae09fe7c6ca.zip
vyos.configdict(): T4228: is_member() must return member interface config dict
This extends commit 39157912 ("vyos.configdict(): T4228: is_member() must use the "real" hardware interface") and returns the config dict of the used member interfaces.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configdict.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index 29d89520c..a61666afc 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -227,13 +227,19 @@ def is_member(conf, interface, intftype=None):
interface = interface.split('.')
if len(interface) == 3:
if conf.exists(['interfaces', member_type, interface[0], 'vif-s', interface[1], 'vif-c', interface[2]]):
- ret_val.update({intf : {}})
+ tmp = conf.get_config_dict(['interfaces', member_type, interface[0]],
+ key_mangling=('-', '_'), get_first_key=True)
+ ret_val.update({intf : tmp})
elif len(interface) == 2:
if conf.exists(['interfaces', member_type, interface[0], 'vif', interface[1]]):
- ret_val.update({intf : {}})
+ tmp = conf.get_config_dict(['interfaces', member_type, interface[0]],
+ key_mangling=('-', '_'), get_first_key=True)
+ ret_val.update({intf : tmp})
else:
if conf.exists(['interfaces', member_type, interface[0]]):
- ret_val.update({intf : {}})
+ tmp = conf.get_config_dict(['interfaces', member_type, interface[0]],
+ key_mangling=('-', '_'), get_first_key=True)
+ ret_val.update({intf : tmp})
return ret_val