1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

Merge pull request #31476 from florianjacob/network-interfaces-assertion-messages

nixos/network-interfaces: Add " around network interface names
This commit is contained in:
Jörg Thalheim 2017-11-10 11:12:49 +00:00 committed by GitHub
commit b72e2ecfe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -923,7 +923,9 @@ in
assertions =
(flip map interfaces (i: {
assertion = i.subnetMask == null;
message = "The networking.interfaces.${i.name}.subnetMask option is defunct. Use prefixLength instead.";
message = ''
The networking.interfaces."${i.name}".subnetMask option is defunct. Use prefixLength instead.
'';
})) ++ (flip map interfaces (i: {
# With the linux kernel, interface name length is limited by IFNAMSIZ
# to 16 bytes, including the trailing null byte.
@ -934,7 +936,9 @@ in
'';
})) ++ (flip map slaveIfs (i: {
assertion = i.ip4 == [ ] && i.ipAddress == null && i.ip6 == [ ] && i.ipv6Address == null;
message = "The networking.interfaces.${i.name} must not have any defined ips when it is a slave.";
message = ''
The networking.interfaces."${i.name}" must not have any defined ips when it is a slave.
'';
})) ++ [
{
assertion = cfg.hostId == null || (stringLength cfg.hostId == 8 && isHexString cfg.hostId);