Skip to content
Snippets Groups Projects
Commit d81cb7e3 authored by Hakan Calim's avatar Hakan Calim Committed by Neda Moeini
Browse files

NAT-329 added validation for juniper interface names

parent 242d10a2
No related branches found
No related tags found
1 merge request!122Feature/nat 329 interface names should validated 3
......@@ -28,6 +28,7 @@ from gso.utils.helpers import (
available_interfaces_choices,
available_interfaces_choices_including_current_members,
get_router_vendor,
validate_interface_name_list,
validate_iptrunk_unique_interface,
)
......@@ -108,6 +109,16 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
def validate_iptrunk_unique_interface_side_a(cls, side_a_ae_members: list[LAGMember]) -> list[LAGMember]:
return validate_iptrunk_unique_interface(side_a_ae_members)
@validator("side_a_ae_members", allow_reuse=True)
def validate_interface_name_members(cls, side_a_ae_members: list[LAGMember]) -> list[LAGMember]:
vendor = subscription.iptrunk.iptrunk_sides[0].iptrunk_side_node.router_vendor
if vendor == RouterVendor.NOKIA:
ret_val = side_a_ae_members
else:
ret_val = validate_interface_name_list(side_a_ae_members)
return ret_val
user_input_side_a = yield ModifyIptrunkSideAForm
ae_members_side_b = initialize_ae_members(subscription, initial_user_input.dict(), 1)
......@@ -128,6 +139,16 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
def validate_iptrunk_unique_interface_side_b(cls, side_b_ae_members: list[LAGMember]) -> list[LAGMember]:
return validate_iptrunk_unique_interface(side_b_ae_members)
@validator("side_b_ae_members", allow_reuse=True)
def validate_interface_name_members(cls, side_b_ae_members: list[LAGMember]) -> list[LAGMember]:
vendor = subscription.iptrunk.iptrunk_sides[1].iptrunk_side_node.router_vendor
if vendor == RouterVendor.NOKIA:
ret_val = side_b_ae_members
else:
ret_val = validate_interface_name_list(side_b_ae_members)
return ret_val
user_input_side_b = yield ModifyIptrunkSideBForm
return initial_user_input.dict() | user_input_side_a.dict() | user_input_side_b.dict()
......
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