Skip to content
Snippets Groups Projects
Commit bd9fc75c authored by Neda Moeini's avatar Neda Moeini Committed by Mohammad Torkashvand
Browse files

Rename EdgePort geant_ga_id to ga_id

parent b2ea69cb
No related branches found
No related tags found
1 merge request!324Feature/manage sid and gids
......@@ -197,7 +197,7 @@ class EdgePortImportModel(BaseModel):
encapsulation: EncapsulationType
name: str
minimum_links: int
geant_ga_id: str | None
ga_id: str | None
mac_address: str | None
partner: str
enable_lacp: bool
......
......@@ -40,7 +40,7 @@
"enable_lacp": "Enable LACP",
"mac_address": "MAC address",
"geant_ga_id": "GÉANT GA-ID"
"ga_id": "GÉANT GA-ID"
}
},
"workflow": {
......
......@@ -52,7 +52,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
minimum_links: int
mac_address: str | None = None
ignore_if_down: bool = False
geant_ga_id: str | None = None
ga_id: str | None = None
@model_validator(mode="after")
def validate_number_of_members(self) -> Self:
......@@ -104,7 +104,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
"minimum_links",
"mac_address",
"ignore_if_down",
"geant_ga_id",
"ga_id",
"enable_lacp",
"edge_port_name",
"edge_port_description",
......@@ -134,7 +134,7 @@ def initialize_subscription(
encapsulation: EncapsulationType,
name: str,
minimum_links: int,
geant_ga_id: str | None,
ga_id: str | None,
mac_address: str | None,
partner: str,
enable_lacp: bool, # noqa: FBT001
......@@ -152,10 +152,10 @@ def initialize_subscription(
subscription.edge_port.edge_port_name = name
subscription.edge_port.minimum_links = minimum_links
subscription.edge_port.ignore_if_down = ignore_if_down
subscription.edge_port.geant_ga_id = geant_ga_id
subscription.edge_port.ga_id = ga_id
subscription.edge_port.mac_address = mac_address
partner_name = get_partner_by_id(partner).name
subscription.description = f"Edge Port {name} on {router.router_fqdn}, " f"{partner_name}, {geant_ga_id or ""}"
subscription.description = f"Edge Port {name} on {router.router_fqdn}, " f"{partner_name}, {ga_id or ""}"
subscription.edge_port.edge_port_description = description
for member in ae_members:
subscription.edge_port.edge_port_ae_members.append(
......
......@@ -48,7 +48,7 @@ def initial_input_form_generator() -> FormGenerator:
minimum_links: int
mac_address: str | None = None
ignore_if_down: bool = False
geant_ga_id: str | None = None
ga_id: str | None = None
description: str | None = None
name: str
ae_members: Annotated[list[LAGMember], AfterValidator(validate_unique_list)]
......@@ -67,7 +67,7 @@ def initialize_subscription(
encapsulation: EncapsulationType,
name: str,
minimum_links: int,
geant_ga_id: str | None,
ga_id: str | None,
mac_address: str | None,
partner: str,
enable_lacp: bool, # noqa: FBT001
......@@ -87,8 +87,8 @@ def initialize_subscription(
subscription.edge_port.minimum_links = minimum_links
subscription.edge_port.edge_port_type = service_type
subscription.edge_port.ignore_if_down = ignore_if_down
subscription.edge_port.geant_ga_id = geant_ga_id
subscription.description = f"Edge Port {name} on {router.router_fqdn}, {partner}, {geant_ga_id or ""}"
subscription.edge_port.ga_id = ga_id
subscription.description = f"Edge Port {name} on {router.router_fqdn}, {partner}, {ga_id or ""}"
for member in ae_members:
subscription.edge_port.edge_port_ae_members.append(
EdgePortAEMemberBlockInactive.new(subscription_id=uuid4(), **member)
......
......@@ -43,7 +43,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
minimum_links: int | None = subscription.edge_port.minimum_links or None
mac_address: str | None = subscription.edge_port.mac_address or None
ignore_if_down: bool = subscription.edge_port.ignore_if_down
geant_ga_id: str | None = subscription.edge_port.geant_ga_id or None
ga_id: str | None = subscription.edge_port.ga_id or None
@model_validator(mode="after")
def validate_number_of_members(self) -> Self:
......@@ -117,7 +117,7 @@ def modify_edge_port_subscription(
encapsulation: EncapsulationType,
minimum_links: int,
mac_address: str | None,
geant_ga_id: str | None,
ga_id: str | None,
enable_lacp: bool, # noqa: FBT001
ae_members: list[dict[str, str]],
ignore_if_down: bool, # noqa: FBT001
......@@ -138,12 +138,12 @@ def modify_edge_port_subscription(
subscription.edge_port.minimum_links = minimum_links
subscription.edge_port.mac_address = mac_address
subscription.edge_port.ignore_if_down = ignore_if_down
subscription.edge_port.geant_ga_id = geant_ga_id
subscription.edge_port.ga_id = ga_id
subscription.edge_port.edge_port_description = description
subscription.description = (
f"Edge Port {subscription.edge_port.edge_port_name} on"
f" {subscription.edge_port.node.router_fqdn},"
f" {get_partner_by_id(subscription.customer_id).name}, {geant_ga_id or ""}"
f" {get_partner_by_id(subscription.customer_id).name}, {ga_id or ""}"
)
subscription.edge_port.edge_port_ae_members.clear()
partner_name = get_partner_by_id(subscription.customer_id).name
......
......@@ -270,7 +270,7 @@ def edge_port_data(temp_file, faker, router_subscription_factory, partner_factor
"encapsulation": EncapsulationType.DOT1Q,
"name": "lag34",
"minimum_links": 2,
"geant_ga_id": faker.geant_gid(),
"ga_id": faker.geant_gid(),
"mac_address": faker.mac_address(),
"partner": partner_factory()["name"],
"enable_lacp": True,
......
......@@ -30,7 +30,7 @@ def edge_port_subscription_factory(faker, partner_factory, router_subscription_f
member_speed=PhysicalPortCapacity.HUNDRED_GIGABIT_PER_SECOND,
minimum_links=None,
edge_port_type=EdgePortType.PUBLIC,
geant_ga_id=None,
ga_id=None,
edge_port_ae_members=None,
status: SubscriptionLifecycle | None = None,
*,
......@@ -52,7 +52,7 @@ def edge_port_subscription_factory(faker, partner_factory, router_subscription_f
)
edge_port_subscription.edge_port.edge_port_description = description or faker.text(max_nb_chars=30)
edge_port_subscription.edge_port.geant_ga_id = geant_ga_id or faker.geant_sid()
edge_port_subscription.edge_port.ga_id = ga_id or faker.geant_gid()
edge_port_subscription.edge_port.node = node or node
edge_port_subscription.edge_port.edge_port_name = name or f"lag-{faker.pyint(21, 50)}"
edge_port_subscription.edge_port.edge_port_description = edge_port_description or faker.sentence()
......
......@@ -50,7 +50,7 @@ def input_form_wizard_data(request, router_subscription_factory, partner_factory
"node": router_subscription_factory(vendor=Vendor.NOKIA),
"partner": partner_factory(name="GAAR", email=faker.email())["partner_id"],
"service_type": EdgePortType.PUBLIC,
"geant_ga_id": faker.geant_gid(),
"ga_id": faker.geant_gid(),
"enable_lacp": True,
"speed": PhysicalPortCapacity.HUNDRED_GIGABIT_PER_SECOND,
"encapsulation": EncapsulationType.DOT1Q,
......@@ -101,7 +101,7 @@ def test_successful_edge_port_creation(
subscription = EdgePort.from_subscription(subscription_id)
assert subscription.status == "active"
ga_id = input_form_wizard_data[0]["geant_ga_id"]
ga_id = input_form_wizard_data[0]["ga_id"]
router_fqdn = Router.from_subscription(input_form_wizard_data[0]["node"]).router.router_fqdn
assert subscription.description == f"Edge Port lag-21 on {router_fqdn}, GAAR, {ga_id}"
assert len(subscription.edge_port.edge_port_ae_members) == 2
......
......@@ -17,7 +17,7 @@ def imported_edge_port_creation_input_form_data(router_subscription_factory, par
"encapsulation": EncapsulationType.DOT1Q,
"name": "lag34",
"minimum_links": 2,
"geant_ga_id": faker.geant_gid(),
"ga_id": faker.geant_gid(),
"mac_address": faker.mac_address(),
"partner": partner_factory()["name"],
"enable_lacp": True,
......
......@@ -21,7 +21,7 @@ def input_form_wizard_data(request, faker, edge_port_subscription_factory, partn
{"subscription_id": subscription_id},
{
"tt_number": faker.tt_number(),
"geant_ga_id": faker.geant_gid(),
"ga_id": faker.geant_gid(),
"member_speed": PhysicalPortCapacity.FOUR_HUNDRED_GIGABIT_PER_SECOND,
"number_of_members": 1,
},
......@@ -89,7 +89,7 @@ def test_modify_edge_port_with_changing_capacity(
assert mocked_attach_interface_to_lag.call_count == 1
assert mocked_free_interface.call_count == 2
assert mocked_detach_interfaces_from_lag.call_count == 1
assert subscription.edge_port.geant_ga_id == input_form_wizard_data[1]["geant_ga_id"]
assert subscription.edge_port.ga_id == input_form_wizard_data[1]["ga_id"]
assert len(subscription.edge_port.edge_port_ae_members) == 1
......@@ -100,7 +100,7 @@ def input_form_wizard_without_changing_capacity(request, faker, edge_port_subscr
return [
{"subscription_id": subscription_id},
{"tt_number": faker.tt_number(), "geant_ga_id": faker.geant_gid()},
{"tt_number": faker.tt_number(), "ga_id": faker.geant_gid()},
{
"description": faker.sentence(),
"ae_members": [
......@@ -163,6 +163,6 @@ def test_modify_edge_port_without_changing_capacity(
assert mocked_free_interface.call_count == 0
assert mocked_detach_interfaces_from_lag.call_count == 0
assert subscription.edge_port.geant_ga_id == input_form_wizard_without_changing_capacity[1]["geant_ga_id"]
assert subscription.edge_port.ga_id == input_form_wizard_without_changing_capacity[1]["ga_id"]
assert len(subscription.edge_port.edge_port_ae_members) == 2
assert subscription.edge_port.edge_port_description == input_form_wizard_without_changing_capacity[2]["description"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment