diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-07-14 20:14:53 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-07-15 07:10:29 +0200 |
commit | 5b4f76429989a6ab8ca64aeed5a1fae09fe7c6ca (patch) | |
tree | 749c6880d346f4b01276ddb3c68910bfef174be6 | |
parent | 87d2dff241d9ab4de9f3a2c7fbf9852934557aef (diff) | |
download | vyos-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.
-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 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 |