Skip to content

Commit

Permalink
Rename a variable for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
sajith committed Sep 14, 2024
1 parent 9a45947 commit 7543d01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sdx_datamodel/models/connection_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__all__ = ["ConnectionRequestV1", "ConnectionRequestV0"]

# Regular expression used for matching VLAN ranges like "100:200".
RANGE_PATTERN = r"(\d+):(\d+)"
VLAN_RANGE_PATTERN = r"(\d+):(\d+)"


class EndPoint(BaseModel):
Expand All @@ -30,7 +30,7 @@ def validate_vlan(cls, value: str) -> str:
return value

# a range like "1:100" is valid.
match = re.match(RANGE_PATTERN, value)
match = re.match(VLAN_RANGE_PATTERN, value)
if match:
x = int(match.group(1))
y = int(match.group(2))
Expand Down Expand Up @@ -122,7 +122,7 @@ def is_range(value):
"""
match a pattern like "100:200"
"""
return bool(re.match(RANGE_PATTERN, value))
return bool(re.match(VLAN_RANGE_PATTERN, value))

# When one endpoint has the VLAN range option in use, all
# other endpoint(s) must have the same VLAN range.
Expand Down

0 comments on commit 7543d01

Please sign in to comment.