Skip to content
Snippets Groups Projects

Fix the error on showing number of members in modify trunk interface workflow.

Merged Neda Moeini requested to merge fix/fix-minimum-links-bug-in-import-and-modify-iptrunk into develop
3 files
+ 31
10
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 16
1
@@ -12,7 +12,7 @@ from pydantic_core.core_schema import ValidationInfo
from pydantic_forms.validators import Choice
from gso import settings
from gso.products.product_blocks.iptrunk import IptrunkInterfaceBlock
from gso.products.product_blocks.iptrunk import IptrunkInterfaceBlock, PhysicalPortCapacity
from gso.products.product_blocks.router import RouterRole
from gso.products.product_blocks.site import LatitudeCoordinate, LongitudeCoordinate, SiteTier
from gso.products.product_types.router import Router
@@ -336,3 +336,18 @@ def generate_inventory_for_active_routers(
}
}
}
def calculate_recommended_minimum_links(iptrunk_number_of_members: int, iptrunk_speed: PhysicalPortCapacity) -> int:
"""Calculate the recommended minimum number of links for an IP trunk based on the number of members and speed.
If the IP trunk speed is 400G, the recommended minimum number of links is the number of members minus 1.
Otherwise, the recommended minimum number of links is the number of members.
:param int iptrunk_number_of_members: The number of members in the IP trunk.
:param PhysicalPortCapacity iptrunk_speed: The speed of the IP trunk.
:return: The recommended minimum number of links for the IP trunk.
"""
if iptrunk_speed == PhysicalPortCapacity.FOUR_HUNDRED_GIGABIT_PER_SECOND:
return iptrunk_number_of_members - 1
return iptrunk_number_of_members
Loading