diff options
| author | Christian Poessinger <christian@poessinger.com> | 2019-09-24 19:10:57 +0200 | 
|---|---|---|
| committer | Christian Poessinger <christian@poessinger.com> | 2019-09-24 21:53:26 +0200 | 
| commit | 8befa5b2aad043dca5d2ba293a7c762f55537c7e (patch) | |
| tree | 6855b16b298508bccd5adc0e30a777089b823c19 | |
| parent | 19cae8e57885034002b3773b289d9f9086937ddc (diff) | |
| download | vyos-1x-8befa5b2aad043dca5d2ba293a7c762f55537c7e.tar.gz vyos-1x-8befa5b2aad043dca5d2ba293a7c762f55537c7e.zip | |
Python/ifconfig: T1557: refactor BondIf 'arp_interval' property to set_arp_interval()
| -rw-r--r-- | python/vyos/ifconfig.py | 28 | ||||
| -rwxr-xr-x | src/conf_mode/interface-bonding.py | 2 | 
2 files changed, 3 insertions, 27 deletions
| diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py index 2c627f0b0..e3404d3e1 100644 --- a/python/vyos/ifconfig.py +++ b/python/vyos/ifconfig.py @@ -1115,29 +1115,7 @@ class BondIf(VLANIf):          return self._write_sysfs('/sys/class/net/{}/bonding/xmit_hash_policy'                                   .format(self._ifname), mode) -    @property -    def arp_interval(self): -        """ -        Specifies the ARP link monitoring frequency in milliseconds. - -        The ARP monitor works by periodically checking the slave devices to -        determine whether they have sent or received traffic recently (the -        precise criteria depends upon the bonding mode, and the state of the -        slave). Regular traffic is generated via ARP probes issued for the -        addresses specified by the arp_ip_target option. - -        The default value is 0. - -        Example: -        >>> from vyos.ifconfig import BondIf -        >>> BondIf('bond0').arp_interval -        '0' -        """ -        return self._read_sysfs('/sys/class/net/{}/bonding/arp_interval' -                                .format(self._ifname)) - -    @arp_interval.setter -    def arp_interval(self, time): +    def set_arp_interval(self, time):          """          Specifies the IP addresses to use as ARP monitoring peers when          arp_interval is > 0. These are the targets of the ARP request sent to @@ -1150,9 +1128,7 @@ class BondIf(VLANIf):          Example:          >>> from vyos.ifconfig import BondIf -        >>> BondIf('bond0').arp_interval = '100' -        >>> BondIf('bond0').arp_interval -        '100' +        >>> BondIf('bond0').set_arp_interval = '100'          """          return self._write_sysfs('/sys/class/net/{}/bonding/arp_interval'                                   .format(self._ifname), time) diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py index e8e22e305..d1617cb1c 100755 --- a/src/conf_mode/interface-bonding.py +++ b/src/conf_mode/interface-bonding.py @@ -349,7 +349,7 @@ def apply(bond):              # reset miimon to default              b.miimon = 250          else: -            b.arp_interval = bond['arp_mon_intvl'] +            b.set_arp_interval(bond['arp_mon_intvl'])          # ARP monitor targets need to be synchronized between sysfs and CLI.          # Unfortunately an address can't be send twice to sysfs as this will | 
