mirror of https://git.48k.eu/ogcp
views: use \s to match whitespace in client import regex
Some programs substitute regular space characters (\u0020) by en spaces
(\u2002) when displaying monospace text. Others replace it by
non-breaking spaces.
Using a character set such as [ \t\n] to match any possible "space
related" character. Use \s to match any kind of whitespace related
character in the regex.
Pasted from python's documentation:
\s
For Unicode (str) patterns:
Matches Unicode whitespace characters (which includes
[ \t\n\r\f\v], and also many other characters, for example the
non-breaking spaces mandated by typography rules in many languages). If
the ASCII flag is used, only [ \t\n\r\f\v] is matched.
[...]
Fixes: d9f8c95618
('views: better dhcp conf parsing when importing clients')
master
parent
d9f8c95618
commit
ae3f83b3c3
|
@ -937,15 +937,15 @@ def action_clients_import_get():
|
|||
scopes=scopes)
|
||||
|
||||
|
||||
OG_REGEX_DHCPD_CONF = (r'(?: *host *)'
|
||||
OG_REGEX_DHCPD_CONF = (r'(?:\s*host\s*)'
|
||||
r'([\w.-]*)'
|
||||
r'(?:[ \n\r]*{[ \n\r]*)'
|
||||
r'(?:[ \t]*hardware *ethernet *)'
|
||||
r'(?:\s*{[ \n\r]*)'
|
||||
r'(?:\s*hardware *ethernet *)'
|
||||
r'((?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2}))'
|
||||
r'(?: *;)'
|
||||
r'(?:[ \t\n\r]*fixed-address *)'
|
||||
r'(?:\s*;)'
|
||||
r'(?:\s*fixed-address *)'
|
||||
r'(\d+\.\d+\.\d+\.\d+)'
|
||||
r'(?: *;)(?:[ \r\n]*[^}]*})')
|
||||
r'(?:\s*;)(?:\s*[^}]*})')
|
||||
OG_CLIENT_DEFAULT_BOOT = "pxe"
|
||||
OG_CLIENT_DEFAULT_LIVEDIR = "ogLive"
|
||||
OG_CLIENT_DEFAULT_MAINTENANCE = False
|
||||
|
|
Loading…
Reference in New Issue