diff --git a/python-avd/pyavd/_eos_designs/structured_config/network_services/utils.py b/python-avd/pyavd/_eos_designs/structured_config/network_services/utils.py index bf52dfc896c..836dbbc49b9 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/network_services/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/network_services/utils.py @@ -260,7 +260,7 @@ def get_vlan_rd( """Return a string with the route-destinguisher for one VLAN.""" rd_override = default(vlan.rd_override, vlan.rt_override, vlan.vni_override) - if isinstance(rd_override, str) and ":" in rd_override: + if isinstance(rd_override, str) and (":" in rd_override or rd_override == "auto"): return rd_override if rd_override is not None: @@ -283,7 +283,7 @@ def get_vlan_rt( """Return a string with the route-target for one VLAN.""" rt_override = default(vlan.rt_override, vlan.vni_override) - if isinstance(rt_override, str) and ":" in rt_override: + if isinstance(rt_override, str) and (":" in rt_override or rt_override == "auto"): return rt_override if self._rt_admin_subfield is not None: @@ -330,7 +330,7 @@ def get_vrf_rd(self: AvdStructuredConfigNetworkServices, vrf: EosDesigns._Dynami rd_override = vrf.rd_override if rd_override is not None: - if ":" in rd_override: + if ":" in rd_override or rd_override == "auto": return rd_override return f"{self.shared_utils.overlay_rd_type_vrf_admin_subfield}:{rd_override}" @@ -341,7 +341,7 @@ def get_vrf_rt(self: AvdStructuredConfigNetworkServices, vrf: EosDesigns._Dynami """Return a string with the route-target for one VRF.""" rt_override = vrf.rt_override - if rt_override is not None and ":" in rt_override: + if rt_override is not None and (":" in rt_override or rt_override == "auto"): return rt_override if self._vrf_rt_admin_subfield is not None: @@ -368,7 +368,7 @@ def get_vlan_aware_bundle_rd( admin_subfield = self.shared_utils.overlay_rd_type_vrf_admin_subfield if is_vrf else self.shared_utils.overlay_rd_type_admin_subfield if rd_override is not None: - if ":" in str(rd_override): + if ":" in rd_override or rd_override == "auto": return rd_override return f"{admin_subfield}:{rd_override}" @@ -385,7 +385,7 @@ def get_vlan_aware_bundle_rt( rt_override: str | None = None, ) -> str: """Return a string with the route-target for one VLAN Aware Bundle.""" - if rt_override is not None and ":" in str(rt_override): + if rt_override is not None and (":" in rt_override or rt_override == "auto"): return rt_override bundle_number = id + tenant.vlan_aware_bundle_number_base