summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig/bridge.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-17 22:55:02 +0200
committerChristian Poessinger <christian@poessinger.com>2020-10-17 22:55:02 +0200
commit183130bcfa3c6bf5dbf73c38c1609c7b6bf21d3f (patch)
treec86c0fb198a3d560e6f6749cd803563f92165362 /python/vyos/ifconfig/bridge.py
parent60109764cc18ae50802313716ce9197c9bd36e15 (diff)
parentb90041af38c1d872210d3720c258721247d313a5 (diff)
downloadvyos-1x-183130bcfa3c6bf5dbf73c38c1609c7b6bf21d3f.tar.gz
vyos-1x-183130bcfa3c6bf5dbf73c38c1609c7b6bf21d3f.zip
Merge branch 'bridge' of github.com:c-po/vyos-1x into current
* 'bridge' of github.com:c-po/vyos-1x: smoketest: add IPv6 option tests to BasicInterfaceTest ifconfig: T2985: support on demand bridge creation geneve: T1799: add IPv6 CLI options op-mode: add "show arp" command
Diffstat (limited to 'python/vyos/ifconfig/bridge.py')
-rw-r--r--python/vyos/ifconfig/bridge.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py
index c133a56fc..7867a7387 100644
--- a/python/vyos/ifconfig/bridge.py
+++ b/python/vyos/ifconfig/bridge.py
@@ -234,25 +234,33 @@ class BridgeIf(Interface):
if member in interfaces():
self.del_port(member)
- STPBridgeIf = STP.enable(BridgeIf)
tmp = vyos_dict_search('member.interface', config)
if tmp:
for interface, interface_config in tmp.items():
- # if we've come here we already verified the interface
- # does not have an addresses configured so just flush
- # any remaining ones
- Interface(interface).flush_addrs()
+ # if interface does yet not exist bail out early and
+ # add it later
+ if interface not in interfaces():
+ continue
+
+ # Bridge lower "physical" interface
+ lower = Interface(interface)
+
+ # If we've come that far we already verified the interface does
+ # not have any addresses configured by CLI so just flush any
+ # remaining ones
+ lower.flush_addrs()
# enslave interface port to bridge
self.add_port(interface)
- tmp = STPBridgeIf(interface)
# set bridge port path cost
- value = interface_config.get('cost')
- tmp.set_path_cost(value)
+ if 'cost' in interface_config:
+ value = interface_config.get('cost')
+ lower.set_path_cost(value)
# set bridge port path priority
- value = interface_config.get('priority')
- tmp.set_path_priority(value)
+ if 'priority' in interface_config:
+ value = interface_config.get('priority')
+ lower.set_path_priority(value)
# Enable/Disable of an interface must always be done at the end of the
# derived class to make use of the ref-counting set_admin_state()