krebs-hosts-*: don't add lines without alias

This commit is contained in:
tv 2019-02-02 09:22:06 +01:00
parent bca298e1a8
commit 1242c7e255

View File

@ -42,7 +42,7 @@ in {
# hostNetAliases : host -> { ${netname} : [addrAliases] } # hostNetAliases : host -> { ${netname} : [addrAliases] }
hostNetAliases = host: hostNetAliases = host:
mapAttrs (_: net: filter (x: x.name != null) [ mapAttrs (_: net: filter (x: x.name != null && x.value != []) [
{ name = net.ip4.addr or null; value = net.aliases; } { name = net.ip4.addr or null; value = net.aliases; }
{ name = net.ip6.addr or null; value = net.aliases; } { name = net.ip6.addr or null; value = net.aliases; }
]) host.nets; ]) host.nets;