From 2fc34dc831e310c019721cd563d17d70ac33df11 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Fri, 10 Feb 2023 12:00:59 +0100 Subject: [PATCH] Unify naming of route table name constants The route tables names are called names, also use "name" in the regex constant instead of "alias". Signed-off-by: Till Maas --- module_utils/network_lsr/argument_validator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module_utils/network_lsr/argument_validator.py b/module_utils/network_lsr/argument_validator.py index 4146e3f..7359337 100644 --- a/module_utils/network_lsr/argument_validator.py +++ b/module_utils/network_lsr/argument_validator.py @@ -295,7 +295,7 @@ class ArgValidatorRouteTable(ArgValidator): if isinstance(table, Util.STRING_TYPE): if table == "": raise ValidationError(name, "route table name cannot be empty string") - if not IPRouteUtils.ROUTE_TABLE_ALIAS_RE.match(table): + if not IPRouteUtils.ROUTE_TABLE_NAME_REGEX.match(table): raise ValidationError( name, "route table name contains invalid characters" ) @@ -2629,7 +2629,7 @@ class IPRouteUtils(object): # as input (in the playbook), and there is no need to accept # user input with unusual characters or non-ASCII names. _ROUTE_TABLE_NAME_PATTERN = "[a-zA-Z0-9_.-]+" - ROUTE_TABLE_ALIAS_RE = re.compile("^" + _ROUTE_TABLE_NAME_PATTERN + "$") + ROUTE_TABLE_NAME_REGEX = re.compile("^" + _ROUTE_TABLE_NAME_PATTERN + "$") @classmethod def _parse_route_tables_mapping(cls, file_content, mapping):