summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 18:51:03 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 21:53:25 +0200
commit3cedc3358c6aeb9e6caad4251958fa1a05723ea3 (patch)
treeec202f63d1255f06f98810f72617cfd6c4f4b5a1 /python
parent3e108025a16a6d4db1bc08ea9161709b13295dfb (diff)
downloadvyos-1x-3cedc3358c6aeb9e6caad4251958fa1a05723ea3.tar.gz
vyos-1x-3cedc3358c6aeb9e6caad4251958fa1a05723ea3.zip
Python/ifconfig: T1557: refactor Interface 'proxy_arp' property to set_proxy_arp()
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 776fe1a23..86a080602 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -314,29 +314,13 @@ class Interface:
cmd = 'ip link set dev {} {}'.format(self._ifname, state)
self._cmd(cmd)
- @property
- def proxy_arp(self):
- """
- Get current proxy ARP configuration from sysfs. Default: 0
-
- Example:
- >>> from vyos.ifconfig import Interface
- >>> Interface('eth0').proxy_arp
- '0'
- """
- return self._read_sysfs('/proc/sys/net/ipv4/conf/{}/proxy_arp'
- .format(self._ifname))
-
- @proxy_arp.setter
- def proxy_arp(self, enable):
+ def set_proxy_arp(self, enable):
"""
Set per interface proxy ARP configuration
Example:
>>> from vyos.ifconfig import Interface
- >>> Interface('eth0').proxy_arp = 1
- >>> Interface('eth0').proxy_arp
- '1'
+ >>> Interface('eth0').set_proxy_arp(1)
"""
if int(enable) >= 0 and int(enable) <= 1:
return self._write_sysfs('/proc/sys/net/ipv4/conf/{}/proxy_arp'