Try specifying the characters
This commit is contained in:
parent
071866cbd6
commit
fed7baa20e
|
@ -57,12 +57,14 @@ let
|
||||||
isNotNull = o: !isNull o;
|
isNotNull = o: !isNull o;
|
||||||
|
|
||||||
hostToFqdn = host:
|
hostToFqdn = host:
|
||||||
if isNotNull (builtins.match "[^.]+\\.$" host) then
|
let hostChars = "[a-zA-Z0-9_-]";
|
||||||
host
|
in if (hasAttr host zone.hosts) then
|
||||||
else if isNotNull (builtins.match "([^.]+\\.)+[^.]+$" host) then
|
|
||||||
"${host}."
|
|
||||||
else if (hasAttr host zone.hosts) then
|
|
||||||
"${host}.${domain}."
|
"${host}.${domain}."
|
||||||
|
else if isNotNull (builtins.match "${hostChars}+\\.$" host) then
|
||||||
|
host
|
||||||
|
else if isNotNull
|
||||||
|
(builtins.match "(${hostChars}+\\.)+${hostChars}+$" host) then
|
||||||
|
"${host}."
|
||||||
else
|
else
|
||||||
abort "unrecognized hostname: ${host}";
|
abort "unrecognized hostname: ${host}";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue