summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-10 21:40:10 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-20 21:28:53 +0200
commit1d2bec57085303420b3e12dc61a44edd62c4c490 (patch)
tree31c0e4d21d961c8934b7802075602006d2ab24dc
parent04399a6e724c95c44e136f4675b04262de73d156 (diff)
downloadvyos-1x-1d2bec57085303420b3e12dc61a44edd62c4c490.tar.gz
vyos-1x-1d2bec57085303420b3e12dc61a44edd62c4c490.zip
ethernet: T1637: handle VLAN interface exception on system startup
On system bootup the above condition is true but the interface does not exists, which throws an exception, but that's legal. Simply pass the exception! With this change VyOS boots up and configures ethernet VLAN interfaces as expected.
-rwxr-xr-xsrc/conf_mode/interface-ethernet.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/conf_mode/interface-ethernet.py b/src/conf_mode/interface-ethernet.py
index a12980bfe..3091e0717 100755
--- a/src/conf_mode/interface-ethernet.py
+++ b/src/conf_mode/interface-ethernet.py
@@ -299,7 +299,12 @@ def apply(eth):
# QoS priority mapping can only be set during interface creation
# so we delete the interface first if required.
if vif['egress_qos_changed'] or vif['ingress_qos_changed']:
- e.del_vlan(vif['id'])
+ try:
+ # on system bootup the above condition is true but the interface
+ # does not exists, which throws an exception, but that's legal
+ e.del_vlan(vif['id'])
+ except:
+ pass
vlan = e.add_vlan(vif['id'], ingress_qos=vif['ingress_qos'], egress_qos=vif['egress_qos'])
apply_vlan_config(vlan, vif)