diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-03-07 12:21:20 +0000 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-03-07 12:21:20 +0000 |
commit | 4bfdaeea5c85e373ab1ea6e5e292dff4a06111ef (patch) | |
tree | d0d2ce2199f5c9873a89e938e39f9ce15f8352b4 /python/vyos/ifconfig | |
parent | 3b7b0a89f4407e3b9c571d80226fb9b191ffb386 (diff) | |
download | vyos-1x-4bfdaeea5c85e373ab1ea6e5e292dff4a06111ef.tar.gz vyos-1x-4bfdaeea5c85e373ab1ea6e5e292dff4a06111ef.zip |
bonding: T2057: fix creation/deletion sysfs command
Diffstat (limited to 'python/vyos/ifconfig')
-rw-r--r-- | python/vyos/ifconfig/bond.py | 8 |
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): """ |