Skip to content

Commit

Permalink
Update ipv4 address parsing with factory=True
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Nov 14, 2023
1 parent a1898af commit f4c4101
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ciscoconfparse/models_iosxr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,12 +1023,12 @@ def ip_addr(self):
def ipv4_addr(self):
r"""Return a string with the interface's IPv4 address, or '' if there is none"""
retval = self.re_match_iter_typed(
r"^\s+ip\s+address\s+(\d+\.\d+\.\d+\.\d+)\s+\d+\.\d+\.\d+\.\d+\s*$",
r"^\s+ipv4\s+address\s+(\d+\.\d+\.\d+\.\d+)\s+\d+\.\d+\.\d+\.\d+\s*$",
result_type=str,
default="",
)
condition1 = self.re_match_iter_typed(
r"^\s+ip\s+address\s+(dhcp)\s*$", result_type=str, default=""
r"^\s+ipv4\s+address\s+(dhcp)\s*$", result_type=str, default=""
)
if condition1.lower() == "dhcp":
error = "Cannot parse address from a dhcp interface: {}".format(self.name)
Expand All @@ -1040,7 +1040,7 @@ def ipv4_addr(self):
def ipv4_netmask(self):
r"""Return a string with the interface's IPv4 netmask, or '' if there is none"""
retval = self.re_match_iter_typed(
r"^\s+ip\s+address\s+\d+\.\d+\.\d+\.\d+\s+(\d+\.\d+\.\d+\.\d+)\s*$",
r"^\s+ipv4\s+address\s+\d+\.\d+\.\d+\.\d+\s+(\d+\.\d+\.\d+\.\d+)\s*$",
result_type=str,
default="",
)
Expand Down

0 comments on commit f4c4101

Please sign in to comment.