summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-01-25 11:23:12 +0100
committerChristian Poessinger <christian@poessinger.com>2020-01-25 11:23:14 +0100
commit0bac5f7a7ba924f7ce793298925466c464e24c88 (patch)
tree4d4ece5073b9433f01b1a837b429648912fb2368 /src
parent7dbb6ec597f8ffe747a6630b79a2b9ba2afcc30f (diff)
downloadvyos-1x-0bac5f7a7ba924f7ce793298925466c464e24c88.tar.gz
vyos-1x-0bac5f7a7ba924f7ce793298925466c464e24c88.zip
list_interfaces: change bonding interface list logic
The previous logic returned: >>> eth = vyos.interfaces.list_interfaces_of_type("ethernet") >>> for intf in eth: ... print(intf) ... eth0 eth1 eth2 eth0.201 eth1.50 >>> for intf in eth: ... if '.' in intf: ... eth.remove(intf) ... >>> eth ['eth0', 'eth1', 'eth2', 'eth1.50'] This only eth0.201 was removed
Diffstat (limited to 'src')
-rwxr-xr-xsrc/completion/list_interfaces.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/completion/list_interfaces.py b/src/completion/list_interfaces.py
index 0ed683074..8cd59917d 100755
--- a/src/completion/list_interfaces.py
+++ b/src/completion/list_interfaces.py
@@ -40,12 +40,13 @@ elif args.bridgeable:
interfaces = eth + bond + l2tpv3 + openvpn + vxlan + tunnel + wireless + geneve
elif args.bondable:
+ interfaces = []
eth = vyos.interfaces.list_interfaces_of_type("ethernet")
+
# we need to filter out VLAN interfaces identified by a dot (.) in their name
for intf in eth:
- if '.' in intf:
- eth.remove(intf)
- interfaces = eth
+ if not '.' in intf:
+ interfaces.append(intf)
else:
interfaces = vyos.interfaces.list_interfaces()