diff options
author | eb3095 <45504889+eb3095@users.noreply.github.com> | 2021-06-01 18:30:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-01 16:30:00 -0600 |
commit | 503e2d398660e8af5d49bdf6944a50ad793a3a31 (patch) | |
tree | f6c339cb1902702b175e56a490323d04d9fe0904 /cloudinit/net/dhcp.py | |
parent | 63f72380a70d9f846cac3b2cbbc6ed13c735c277 (diff) | |
download | vyos-cloud-init-503e2d398660e8af5d49bdf6944a50ad793a3a31.tar.gz vyos-cloud-init-503e2d398660e8af5d49bdf6944a50ad793a3a31.zip |
Allow braces to appear in dhclient output (#911)
dhclient output that contains brackets for pxe variables will break
the dhclient parsing regex line. This fix retains the current
functionality while fixing this particular issue.
Diffstat (limited to 'cloudinit/net/dhcp.py')
-rw-r--r-- | cloudinit/net/dhcp.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/net/dhcp.py b/cloudinit/net/dhcp.py index 4394c68b..9b94c9a0 100644 --- a/cloudinit/net/dhcp.py +++ b/cloudinit/net/dhcp.py @@ -173,7 +173,7 @@ def parse_dhcp_lease_file(lease_file): @raises: InvalidDHCPLeaseFileError on empty of unparseable leasefile content. """ - lease_regex = re.compile(r"lease {(?P<lease>[^}]*)}\n") + lease_regex = re.compile(r"lease {(?P<lease>.*?)}\n", re.DOTALL) dhcp_leases = [] lease_content = util.load_file(lease_file) if len(lease_content) == 0: |