From cb738721c15ac01f49f66144dae80eb478331f77 Mon Sep 17 00:00:00 2001 From: omnom62 <75066712+omnom62@users.noreply.github.com> Date: Sat, 22 Aug 2026 01:04:18 +1000 Subject: T8989: wave 2 modules: interfaces, l3_interfaces, lag_interfaces, lldp_interfaces, ospfv2/3, ospf_interfaces * T8989: vyos_interfaces * T8989: vyos_interfaces changelog * T8989: vyos_interfaces changelog * T8989: changelog typo * T8989: vyos_l3_interfaces module * T8989: vyos_l3_interfaces module SIT and UAT * T8989: vyos_l3_interfaces doc * T8989: lag_interfaces * T8989: lag interfaces * T8989: lldp_interfaces * T8989: lldp_interfaces module * T8989: SIT updated * T8989: SIT updated * T8989: SIT updated * T8989: typo fixes * T8989: SIT and UAT updates * T8989: ospf_v3 module * T8989: ospf_v3 module * T8989: vyos_ospf_interfaces * T8989: vyos_ospf_interfaces SIT * T8989: vyos_ospf_interfaces SIT * T8989: vyos_ospfv3 SIT and UAT --------- Co-authored-by: John Estabrook --- plugins/modules/vyos_route_maps.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'plugins/modules/vyos_route_maps.py') diff --git a/plugins/modules/vyos_route_maps.py b/plugins/modules/vyos_route_maps.py index 55b1706..607d1ab 100644 --- a/plugins/modules/vyos_route_maps.py +++ b/plugins/modules/vyos_route_maps.py @@ -308,7 +308,7 @@ def _want_to_api_match(match): return api -def _rule_cmds(rm_name, rule, have_rule): +def _rule_cmds(rm_name, rule, have_rule, state="merged"): cmds = [] seq = str(rule["sequence"]) rbase = _BASE + [rm_name, "rule", seq] @@ -343,8 +343,13 @@ def _rule_cmds(rm_name, rule, have_rule): want_set_api = _want_to_api_set(rule.get("set")) have_set = have_rule.get("set") or {} - if want_set_api != have_set: - cmds += _set_cmds(rbase, rule.get("set")) + if state in ("replaced", "overridden"): + if want_set_api != have_set: + cmds += _set_cmds(rbase, rule.get("set")) + else: + have_subset = {k: have_set[k] for k in want_set_api if k in have_set} + if want_set_api != have_subset: + cmds += _set_cmds(rbase, rule.get("set")) return cmds @@ -380,7 +385,7 @@ def build_commands(config, have_raw, state): test_cmds = [] for rule in rm.get("entries") or []: have_rule = have_entries.get(str(rule["sequence"]), {}) - test_cmds += _rule_cmds(rm_name, rule, have_rule) + test_cmds += _rule_cmds(rm_name, rule, have_rule, state) if test_cmds or extra_seqs: cmds.append(("delete", _BASE + [rm_name])) have_rm = {} @@ -391,7 +396,7 @@ def build_commands(config, have_raw, state): for rule in rm.get("entries") or []: have_rule = have_entries.get(str(rule["sequence"]), {}) - cmds += _rule_cmds(rm_name, rule, have_rule) + cmds += _rule_cmds(rm_name, rule, have_rule, state) return cmds -- cgit v1.2.3