diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-10-17 22:55:02 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-10-17 22:55:02 +0200 |
commit | 183130bcfa3c6bf5dbf73c38c1609c7b6bf21d3f (patch) | |
tree | c86c0fb198a3d560e6f6749cd803563f92165362 /python/vyos/ifconfig/bridge.py | |
parent | 60109764cc18ae50802313716ce9197c9bd36e15 (diff) | |
parent | b90041af38c1d872210d3720c258721247d313a5 (diff) | |
download | vyos-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.py | 28 |
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() |