diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-09-24 22:09:07 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-09-24 22:09:07 +0200 |
commit | c24eb48c54b562fe7f78cdda82f2e245e9ab8506 (patch) | |
tree | e51f4d72af89d7918ba5cd2adca01f4b4e5040b8 /src/conf_mode/interface-vxlan.py | |
parent | 6b828200e698dbff5a3ee61a0c6c9906b0a8493f (diff) | |
parent | 0588f5409f57a8d8577bc9bd23c393487fd2987b (diff) | |
download | vyos-1x-c24eb48c54b562fe7f78cdda82f2e245e9ab8506.tar.gz vyos-1x-c24eb48c54b562fe7f78cdda82f2e245e9ab8506.zip |
Merge branch 'ifconfig-api-change' of github.com:c-po/vyos-1x into current
* 'ifconfig-api-change' of github.com:c-po/vyos-1x: (26 commits)
Python/ifconfig: T1557: add STPIf class (spanning tree) bridge member
Python/ifconfig: T1557: bugfix removing Q-in-Q VLAN interfaces
openvpn: T1548: setup interface alias
Python/ifconfig: T1557: refactor BondIf 'mode' property to set_mode()
Python/ifconfig: T1557: refactor BondIf 'arp_interval' property to set_arp_interval()
Python/ifconfig: T1557: refactor BondIf 'arp_ip_target' property to set_arp_ip_target()/get_arp_ip_target()
Python/ifconfig: T1557: refactor BondIf 'arp_interval' property to set_arp_interval()
Python/ifconfig: T1557: refactor BondIf 'xmit_hash_policy' property to set_hash_policy()
Python/ifconfig: T1557: remove unused has_autoneg() from EthernetIf
Python/ifconfig: T1557: refactor Interface 'state' property to set_state()/get_state()
Python/ifconfig: T1557: refactor Interface 'arp_cache_tmo' property to set_set_arp_cache_tmo()
Python/ifconfig: T1557: refactor Interface 'proxy_arp_pvlan' property to set_proxy_arp_pvlan()
Python/ifconfig: T1557: refactor Interface 'proxy_arp' property to set_proxy_arp()
Python/ifconfig: T1557: loopback: implement derived remove()
Python/ifconfig: T1557: refactor Interface 'ifalias' property to set_alias()
Python/ifconfig: T1557: refactor Interface 'link_detect' property to set_link_detect()
Python/ifconfig: T1557: refactor BridgeIf 'stp_state' property to set_stp()
Python/ifconfig: T1557: refactor BridgeIf 'priority' property to set_priority()
Python/ifconfig: T1557: refactor BridgeIf 'ageing_time' property to set_ageing_time()
Python/ifconfig: T1557: refactor BridgeIf 'hello_time' property to set_hello_time()
...
Diffstat (limited to 'src/conf_mode/interface-vxlan.py')
-rwxr-xr-x | src/conf_mode/interface-vxlan.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/conf_mode/interface-vxlan.py b/src/conf_mode/interface-vxlan.py index e97b4bf99..1097ae4d0 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 <http://www.gnu.org/licenses/>. -# -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)) @@ -163,14 +163,14 @@ def apply(vxlan): # Finally create the new interface v = VXLANIf(vxlan['intf'], config=conf) # update interface description used e.g. by SNMP - v.ifalias = vxlan['description'] + v.set_alias(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'] + v.set_arp_cache_tmo(vxlan['ip_arp_cache_tmo']) # Enable proxy-arp on this interface - v.proxy_arp = vxlan['ip_proxy_arp'] + v.set_proxy_arp(vxlan['ip_proxy_arp']) # Configure interface address(es) - no need to implicitly delete the # old addresses as they have already been removed by deleting the @@ -182,7 +182,7 @@ def apply(vxlan): # parameters we will only re-enable the interface if it is not # administratively disabled if not vxlan['disable']: - v.state='up' + v.set_state('up') return None |