summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 18:56:05 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 21:53:25 +0200
commit09f4553ffdbf3c35696f08118d75793db33cb59b (patch)
tree8944db754488689314f5cec66cde65aba4de1642 /python/vyos
parent48e5ad611bc63575eb1150024939d04eb62cf400 (diff)
downloadvyos-1x-09f4553ffdbf3c35696f08118d75793db33cb59b.tar.gz
vyos-1x-09f4553ffdbf3c35696f08118d75793db33cb59b.zip
Python/ifconfig: T1557: refactor Interface 'arp_cache_tmo' property to set_set_arp_cache_tmo()
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/ifconfig.py18
1 files changed, 2 insertions, 16 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index d32b54199..5fa9f4f2b 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -208,29 +208,15 @@ class Interface:
cmd = 'ip link set dev {} address {}'.format(self._ifname, mac)
self._cmd(cmd)
- @property
- def arp_cache_tmo(self):
- """
- Get configured ARP cache timeout value from interface in seconds.
- Internal Kernel representation is in milliseconds.
-
- Example:
- >>> from vyos.ifconfig import Interface
- >>> Interface('eth0').arp_cache_tmo
- '30'
- """
- return (self._read_sysfs('/proc/sys/net/ipv4/neigh/{0}/base_reachable_time_ms'
- .format(self._ifname)) / 1000)
- @arp_cache_tmo.setter
- def arp_cache_tmo(self, tmo):
+ def set_arp_cache_tmo(self, tmo):
"""
Set ARP cache timeout value in seconds. Internal Kernel representation
is in milliseconds.
Example:
>>> from vyos.ifconfig import Interface
- >>> Interface('eth0').arp_cache_tmo = '40'
+ >>> Interface('eth0').set_arp_cache_tmo(40)
"""
return self._write_sysfs('/proc/sys/net/ipv4/neigh/{0}/base_reachable_time_ms'
.format(self._ifname), (int(tmo) * 1000))