diff options
author | CaptTrews <capttrews@gmail.com> | 2019-08-27 14:58:55 +0000 |
---|---|---|
committer | CaptTrews <capttrews@gmail.com> | 2019-08-27 14:58:55 +0000 |
commit | 31dda8ff9f9d8935b18b5fc96c94fa3fda263d34 (patch) | |
tree | 4bb710d82eebbac52a44fece5f6da87f0a198896 | |
parent | 74e4990a7ff571f361d5c238da10f347329546fb (diff) | |
download | vyos.vyos-31dda8ff9f9d8935b18b5fc96c94fa3fda263d34.tar.gz vyos.vyos-31dda8ff9f9d8935b18b5fc96c94fa3fda263d34.zip |
Updated from network content collector
Signed-off-by: CaptTrews <capttrews@gmail.com>
-rw-r--r-- | plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py | 34 |
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", ) ) |