From d77f68ef3198cff019e1e2d74dfe2290800a1ea6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 24 Sep 2019 18:04:17 +0200 Subject: Python/ifconfig: T1557: refactor 'mtu' property to get_mtu()/set_mtu() --- python/vyos/ifconfig.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'python') diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py index 8d4923957..a128c3d54 100644 --- a/python/vyos/ifconfig.py +++ b/python/vyos/ifconfig.py @@ -145,28 +145,26 @@ class Interface: cmd = 'ip link del dev {}'.format(self._ifname) self._cmd(cmd) - @property - def mtu(self): + def get_mtu(self): """ Get/set interface mtu in bytes. Example: >>> from vyos.ifconfig import Interface - >>> Interface('eth0').mtu + >>> Interface('eth0').get_mtu() '1500' """ return self._read_sysfs('/sys/class/net/{}/mtu' .format(self._ifname)) - @mtu.setter - def mtu(self, mtu): + def set_mtu(self, mtu): """ Get/set interface mtu in bytes. Example: >>> from vyos.ifconfig import Interface - >>> Interface('eth0').mtu = 1400 - >>> Interface('eth0').mtu + >>> Interface('eth0').set_mtu(1400) + >>> Interface('eth0').get_mtu() '1400' """ if mtu < 68 or mtu > 9000: -- cgit v1.2.3