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() --- src/conf_mode/interface-vxlan.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/conf_mode/interface-vxlan.py') diff --git a/src/conf_mode/interface-vxlan.py b/src/conf_mode/interface-vxlan.py index e97b4bf99..f0fa7596a 100755 --- a/src/conf_mode/interface-vxlan.py +++ b/src/conf_mode/interface-vxlan.py @@ -13,9 +13,9 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# -from os import environ +import os + from sys import exit from copy import deepcopy @@ -48,7 +48,7 @@ def get_config(): # determine tagNode instance try: - vxlan['intf'] = environ['VYOS_TAGNODE_VALUE'] + vxlan['intf'] = os.environ['VYOS_TAGNODE_VALUE'] except KeyError as E: print("Interface not specified") @@ -127,7 +127,7 @@ def verify(vxlan): if vxlan['link']: # VXLAN adds a 50 byte overhead - we need to check the underlaying MTU # if our configured MTU is at least 50 bytes less - underlay_mtu = int(Interface(vxlan['link']).mtu) + underlay_mtu = int(Interface(vxlan['link']).get_mtu()) if underlay_mtu < (vxlan['mtu'] + 50): raise ConfigError('VXLAN has a 50 byte overhead, underlaying device ' \ 'MTU is to small ({})'.format(underlay_mtu)) @@ -165,7 +165,7 @@ def apply(vxlan): # update interface description used e.g. by SNMP v.ifalias = vxlan['description'] # Maximum Transfer Unit (MTU) - v.mtu = vxlan['mtu'] + v.set_mtu(vxlan['mtu']) # configure ARP cache timeout in milliseconds v.arp_cache_tmp = vxlan['ip_arp_cache_tmo'] -- cgit v1.2.3