nixos/python-test-driver: allow single char as hostName and fix misleading error-message

In case of invalid chars, the error-message references "perl variables"
which is not the case here as the python-based framework is used.
This commit is contained in:
Maximilian Bosch 2020-03-13 01:03:31 +01:00
parent ed1db01785
commit 6d14bac048
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

View file

@ -175,13 +175,13 @@ in rec {
nodeNames = builtins.attrNames nodes;
invalidNodeNames = lib.filter
(node: builtins.match "^[A-z_][A-z0-9_]+$" node == null) nodeNames;
(node: builtins.match "^[A-z_]([A-z0-9_]+)?$" node == null) nodeNames;
in
if lib.length invalidNodeNames > 0 then
throw ''
Cannot create machines out of (${lib.concatStringsSep ", " invalidNodeNames})!
All machines are referenced as perl variables in the testing framework which will break the
All machines are referenced as python variables in the testing framework which will break the
script when special characters are used.
Please stick to alphanumeric chars and underscores as separation.