summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-07 13:35:46 +0100
committerGitHub <noreply@github.com>2020-03-07 13:35:46 +0100
commit23010444a1136616bdcbae47811b8cc0f0aea1f0 (patch)
treed0d2ce2199f5c9873a89e938e39f9ce15f8352b4 /python/vyos
parent3b7b0a89f4407e3b9c571d80226fb9b191ffb386 (diff)
parent4bfdaeea5c85e373ab1ea6e5e292dff4a06111ef (diff)
downloadvyos-1x-23010444a1136616bdcbae47811b8cc0f0aea1f0.tar.gz
vyos-1x-23010444a1136616bdcbae47811b8cc0f0aea1f0.zip
Merge pull request #244 from thomas-mangin/fix-bond
bonding: T2057: fix creation/deletion sysfs command
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/ifconfig/bond.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py
index 6e4c281be..211790459 100644
--- a/python/vyos/ifconfig/bond.py
+++ b/python/vyos/ifconfig/bond.py
@@ -48,10 +48,10 @@ class BondIf(VLANIf):
'location': '/sys/class/net/{ifname}/bonding/arp_ip_target',
},
'bond_add_port': {
- 'location': '/sys/class/net/{ifname}+{value}/bonding/slaves',
+ 'location': '/sys/class/net/{ifname}/bonding/slaves',
},
'bond_del_port': {
- 'location': '/sys/class/net/{ifname}-{value}/bonding/slaves',
+ 'location': '/sys/class/net/{ifname}/bonding/slaves',
},
'bond_primary': {
'convert': lambda name: name if name else '\0',
@@ -204,7 +204,7 @@ class BondIf(VLANIf):
# interface is in 'up' state, the following Kernel error will be thrown:
# bond0: eth1 is up - this may be due to an out of date ifenslave.
Interface(interface).set_state('down')
- return self.set_interface('bond_add_port', interface)
+ return self.set_interface('bond_add_port', f'+{interface}')
def del_port(self, interface):
"""
@@ -214,7 +214,7 @@ class BondIf(VLANIf):
>>> from vyos.ifconfig import BondIf
>>> BondIf('bond0').del_port('eth1')
"""
- return self.set_interface('bond_del_port', interface)
+ return self.set_interface('bond_del_port', f'-{interface}')
def get_slaves(self):
"""