summaryrefslogtreecommitdiff
path: root/src/conf_mode/interface-bridge.py
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2019-09-04 13:18:02 -0700
committerhagbard <vyosdev@derith.de>2019-09-04 13:18:02 -0700
commitd1a121d54e114640da6f020c859865c9b5259091 (patch)
treea9e9b98165ef8688b339cfd954209b3892db3851 /src/conf_mode/interface-bridge.py
parenta4f34dfe7e003510a4e6263b012b79221a5a786f (diff)
parent952871200ecee584e7ed1bcb37bdaa06111e3a72 (diff)
downloadvyos-1x-d1a121d54e114640da6f020c859865c9b5259091.tar.gz
vyos-1x-d1a121d54e114640da6f020c859865c9b5259091.zip
Merge branch 'current' of https://github.com/vyos/vyos-1x into current
Diffstat (limited to 'src/conf_mode/interface-bridge.py')
-rwxr-xr-xsrc/conf_mode/interface-bridge.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/conf_mode/interface-bridge.py b/src/conf_mode/interface-bridge.py
index 1d3587114..b165428ee 100755
--- a/src/conf_mode/interface-bridge.py
+++ b/src/conf_mode/interface-bridge.py
@@ -21,8 +21,10 @@ import os
from copy import deepcopy
from sys import exit
from netifaces import interfaces
-from vyos.config import Config
+
from vyos.ifconfig import BridgeIf, Interface
+from vyos.configdict import list_diff
+from vyos.config import Config
from vyos import ConfigError
default_config_data = {
@@ -46,10 +48,6 @@ default_config_data = {
'stp': 0
}
-def diff(first, second):
- second = set(second)
- return [item for item in first if item not in second]
-
def get_config():
bridge = deepcopy(default_config_data)
conf = Config()
@@ -137,13 +135,13 @@ def get_config():
# interfaces is no longer assigend to the bridge and thus can be removed
eff_intf = conf.list_effective_nodes('member interface')
act_intf = conf.list_nodes('member interface')
- bridge['member_remove'] = diff(eff_intf, act_intf)
+ bridge['member_remove'] = list_diff(eff_intf, act_intf)
# Determine interface addresses (currently effective) - to determine which
# address is no longer valid and needs to be removed from the bridge
eff_addr = conf.return_effective_values('address')
act_addr = conf.return_values('address')
- bridge['address_remove'] = diff(eff_addr, act_addr)
+ bridge['address_remove'] = list_diff(eff_addr, act_addr)
# Priority for this bridge
if conf.exists('priority'):