summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conf_mode/vpp_interfaces_bonding.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/conf_mode/vpp_interfaces_bonding.py b/src/conf_mode/vpp_interfaces_bonding.py
index c7fd43bb4..932287a03 100644
--- a/src/conf_mode/vpp_interfaces_bonding.py
+++ b/src/conf_mode/vpp_interfaces_bonding.py
@@ -18,6 +18,7 @@
from vyos.config import Config
from vyos.configdict import get_interface_dict
+from vyos.configdict import is_node_changed
from vyos.configdep import set_dependents, call_dependents
from vyos.configverify import verify_mtu_ipv6
from vyos import ConfigError
@@ -108,6 +109,12 @@ def get_config(config=None) -> dict:
no_tag_node_value_mangle=True,
)
+ iface_path = ['interfaces', 'vpp', 'bonding', ifname]
+ rebuild_required_nodes = ['mode', 'hash-policy', 'mac']
+ for node in rebuild_required_nodes:
+ if is_node_changed(conf, iface_path + [node]):
+ config.update({'rebuild_required': {}})
+
config['bond_members'] = deps_bond_dict(conf)
# Dependency
@@ -225,10 +232,12 @@ def apply(config):
ifname = config.get('ifname')
bond = VPPBondInterface(ifname, config)
- bond.remove()
+
+ if 'deleted' in config or 'rebuild_required' in config:
+ bond.remove()
if 'deleted' in config:
- return
+ return None
bond.update(config)