summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py34
1 files changed, 27 insertions, 7 deletions
diff --git a/plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py b/plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py
index 44a8a62..e7f788a 100644
--- a/plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py
+++ b/plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py
@@ -307,12 +307,20 @@ class Lag_interfaces(ConfigBase):
if "interval" in arp_monitor:
commands.append(
self._compute_command(
- key, "interval", str(arp_monitor["interval"])
+ key=want["name"] + " arp-monitor",
+ attrib="interval",
+ value=str(arp_monitor["interval"]),
)
)
if diff_targets:
for target in diff_targets:
- commands.append(self._compute_commands(key, "target", target))
+ commands.append(
+ self._compute_command(
+ key=want["name"] + " arp-monitor",
+ attrib="target",
+ value=target,
+ )
+ )
return commands
def _delete_bond_members(self, have):
@@ -335,7 +343,6 @@ class Lag_interfaces(ConfigBase):
have_arp_target = []
want_arp_monitor = want.get(key) or {}
have_arp_monitor = have.get(key) or {}
- del_cmd = "delete interface bonding " + have["name"]
if want_arp_monitor and "target" in want_arp_monitor:
want_arp_target = want_arp_monitor["target"]
@@ -344,12 +351,25 @@ class Lag_interfaces(ConfigBase):
have_arp_target = have_arp_monitor["target"]
if "interval" in have_arp_monitor and not want_arp_monitor:
- commands.append(del_cmd + " " + key + " interval")
+ commands.append(
+ self._compute_command(
+ key=have["name"] + " arp-monitor",
+ attrib="interval",
+ remove=True,
+ )
+ )
if "target" in have_arp_monitor:
target_diff = list_diff_have_only(want_arp_target, have_arp_target)
if target_diff:
for target in target_diff:
- commands.append(del_cmd + " " + key + " target " + target)
+ commands.append(
+ self._compute_command(
+ key=have["name"] + " arp-monitor",
+ attrib="target",
+ value=target,
+ remove=True,
+ )
+ )
return commands
@@ -363,10 +383,10 @@ class Lag_interfaces(ConfigBase):
for member in members_diff:
commands.append(
self._compute_command(
- member[key],
+ member["member"],
"bond-group",
have["name"],
- False,
+ True,
"ethernet",
)
)