diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-07-14 20:14:53 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-07-18 08:14:33 +0200 |
commit | 37416e6503998c8d9ef3d20e6b88e92a49bc1115 (patch) | |
tree | bf8d46fed6891b71dfcc5223c3f1b6208da97ed8 /python/vyos/configdict.py | |
parent | 752ddaff0a806527ab6cc787b4ab2a60fec01886 (diff) | |
download | vyos-1x-37416e6503998c8d9ef3d20e6b88e92a49bc1115.tar.gz vyos-1x-37416e6503998c8d9ef3d20e6b88e92a49bc1115.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.
(cherry picked from commit 5b4f76429989a6ab8ca64aeed5a1fae09fe7c6ca)
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r-- | python/vyos/configdict.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 37cf2e114..70e5cd889 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -233,13 +233,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}) old_level = conf.set_level(old_level) return ret_val |