summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces-bonding.py7
-rwxr-xr-xsrc/conf_mode/interfaces-bridge.py7
-rwxr-xr-xsrc/conf_mode/interfaces-dummy.py7
-rwxr-xr-xsrc/conf_mode/interfaces-ethernet.py7
-rwxr-xr-xsrc/conf_mode/interfaces-pseudo-ethernet.py7
-rwxr-xr-xsrc/conf_mode/interfaces-wireless.py7
6 files changed, 12 insertions, 30 deletions
diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py
index a75beabd1..03df6e16a 100755
--- a/src/conf_mode/interfaces-bonding.py
+++ b/src/conf_mode/interfaces-bonding.py
@@ -461,11 +461,8 @@ def apply(bond):
for addr in bond['address']:
b.add_addr(addr)
- # assign to VRF
- if bond['vrf']:
- b.add_vrf(bond['vrf'])
- else:
- b.del_vrf(bond['vrf'])
+ # assign/remove VRF
+ b.set_vrf(bond['vrf'])
# remove no longer required service VLAN interfaces (vif-s)
for vif_s in bond['vif_s_remove']:
diff --git a/src/conf_mode/interfaces-bridge.py b/src/conf_mode/interfaces-bridge.py
index f189ce36d..f8f20bf5c 100755
--- a/src/conf_mode/interfaces-bridge.py
+++ b/src/conf_mode/interfaces-bridge.py
@@ -295,11 +295,8 @@ def apply(bridge):
# store DHCPv6 config dictionary - used later on when addresses are aquired
br.set_dhcpv6_options(opt)
- # assign to VRF
- if bridge['vrf']:
- br.add_vrf(bridge['vrf'])
- else:
- br.del_vrf(bridge['vrf'])
+ # assign/remove VRF
+ br.set_vrf(bridge['vrf'])
# Change interface MAC address
if bridge['mac']:
diff --git a/src/conf_mode/interfaces-dummy.py b/src/conf_mode/interfaces-dummy.py
index 10cae5d7d..bf55b13ec 100755
--- a/src/conf_mode/interfaces-dummy.py
+++ b/src/conf_mode/interfaces-dummy.py
@@ -105,11 +105,8 @@ def apply(dummy):
for addr in dummy['address']:
d.add_addr(addr)
- # assign to VRF
- if dummy['vrf']:
- d.add_vrf(dummy['vrf'])
- else:
- d.del_vrf(dummy['vrf'])
+ # assign/remove VRF
+ d.set_vrf(dummy['vrf'])
# disable interface on demand
if dummy['disable']:
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py
index ba3a5e8c8..2f5d796b4 100755
--- a/src/conf_mode/interfaces-ethernet.py
+++ b/src/conf_mode/interfaces-ethernet.py
@@ -369,11 +369,8 @@ def apply(eth):
for addr in eth['address']:
e.add_addr(addr)
- # assign to VRF
- if eth['vrf']:
- e.add_vrf(eth['vrf'])
- else:
- e.del_vrf(eth['vrf'])
+ # assign/remove VRF
+ e.set_vrf(eth['vrf'])
# remove no longer required service VLAN interfaces (vif-s)
for vif_s in eth['vif_s_remove']:
diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py
index 989b1432b..0afae8388 100755
--- a/src/conf_mode/interfaces-pseudo-ethernet.py
+++ b/src/conf_mode/interfaces-pseudo-ethernet.py
@@ -297,11 +297,8 @@ def apply(peth):
# Enable private VLAN proxy ARP on this interface
p.set_proxy_arp_pvlan(peth['ip_proxy_arp_pvlan'])
- # assign to VRF
- if peth['vrf']:
- p.add_vrf(peth['vrf'])
- else:
- p.del_vrf(peth['vrf'])
+ # assign/remove VRF
+ p.set_vrf(peth['vrf'])
# Change interface MAC address
if peth['mac']:
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py
index 40d8912cc..59fb21125 100755
--- a/src/conf_mode/interfaces-wireless.py
+++ b/src/conf_mode/interfaces-wireless.py
@@ -1443,11 +1443,8 @@ def apply(wifi):
# ignore link state changes
w.set_link_detect(wifi['disable_link_detect'])
- # assign to VRF
- if wifi['vrf']:
- w.add_vrf(wifi['vrf'])
- else:
- w.del_vrf(wifi['vrf'])
+ # assign/remove VRF
+ w.set_vrf(wifi['vrf'])
# Change interface MAC address - re-set to real hardware address (hw-id)
# if custom mac is removed