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

NAT-329: fixed iteration over LAGMember list

parent 85efbaf9
No related branches found
No related tags found
1 merge request!122Feature/nat 329 interface names should validated 3
This commit is part of merge request !122. Comments created here will be created in the context of that merge request.
......@@ -279,15 +279,12 @@ def validate_interface_name_list(interface_name_list: list) -> list:
Returns:
-------
list: The list of interface names if all match was successfull.
Otherwise it will throw a ValueError exception.
list: The list of interface names if all match was successful, otherwise it will throw a ValueError exception.
"""
pattern = re.compile(r"^(ge|et|xe)-[0-9]/[0-9]/[0-9]$")
for interface_name in interface_name_list:
if not bool(pattern.match(interface_name)):
error_msg = (
for interface in interface_name_list:
if not bool(pattern.match(interface.interface_name)):
raise ValueError(
f"Invalid interface name. The interface name should be of format: "
f"xe-1/0/0. Got: [{interface_name}]")
raise ValueError(error_msg)
f"xe-1/0/0. Got: [{interface.interface_name}]")
return interface_name_list
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