Skip to content

Commit

Permalink
Apply suggestion on lbpolicy creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxmikant Chintakindi authored and laxmikantchintakindi committed Feb 25, 2025
1 parent 50c5cc2 commit f548021
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def _wan_load_balance_policies(self: AvdStructuredConfigNetworkServicesProtocol)
for policy in self._filtered_wan_policies:
for match in policy.get("matches", []):
if "load_balance_policy" in match:
lb_policy = EosCliConfigGen.RouterPathSelection.LoadBalancePoliciesItem()
lb_policy._update(
lb_policy = EosCliConfigGen.RouterPathSelection.LoadBalancePoliciesItem(
name=get(match["load_balance_policy"], "name", None),
lowest_hop_count=get(match["load_balance_policy"], "lowest_hop_count", None),
jitter=get(match["load_balance_policy"], "jitter", None),
Expand All @@ -61,8 +60,7 @@ def _wan_load_balance_policies(self: AvdStructuredConfigNetworkServicesProtocol)
self.structured_config.router_path_selection.load_balance_policies.append(lb_policy)

if (default_match := policy.get("default_match")) is not None and "load_balance_policy" in default_match:
lb_policy = EosCliConfigGen.RouterPathSelection.LoadBalancePoliciesItem()
lb_policy._update(
lb_policy = EosCliConfigGen.RouterPathSelection.LoadBalancePoliciesItem(
name=get(default_match["load_balance_policy"], "name", None),
)
for group in get(default_match["load_balance_policy"], "path_groups", None):
Expand Down

0 comments on commit f548021

Please sign in to comment.