diff --git a/gso/utils/helpers.py b/gso/utils/helpers.py index 28269a3da83dc0f745ef31a46361e9c6952e7d2f..d27e7c6d83f8c3888bd9d34dcae6f1848a4ce3f6 100644 --- a/gso/utils/helpers.py +++ b/gso/utils/helpers.py @@ -252,8 +252,8 @@ def validate_interface_name_list(interface_name_list: list, vendor: str) -> list """Validate that the provided interface name matches the expected pattern. The expected pattern for the interface name is one of 'ge', 'et', 'xe' followed by a dash '-', - then a digit between 0 and 9, a forward slash '/', another digit between 0 and 9, - another forward slash '/', and ends with a digit between 0 and 9. + then a number between 0 and 19, a forward slash '/', another number between 0 and 99, + another forward slash '/', and ends with a number between 0 and 99. For example: 'xe-1/0/0'. :param list interface_name_list: List of interface names to validate. @@ -265,7 +265,7 @@ def validate_interface_name_list(interface_name_list: list, vendor: str) -> list # For Nokia nothing to do if vendor == Vendor.NOKIA: return interface_name_list - pattern = re.compile(r"^(ge|et|xe)-[0-9]/[0-9]/[0-9]$") + pattern = re.compile(r"^(ge|et|xe)-1?[0-9]/[0-9]{1,2}/[0-9]{1,2}$") for interface in interface_name_list: if not bool(pattern.match(interface.interface_name)): error_msg = (