From d6b8716e00d06819fe8f8e15e67d7b8c3b8a6673 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Thu, 21 Nov 2024 12:59:19 +0100 Subject: [PATCH] Inventory/constraints: improve assertion messages --- lib/constraints/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/constraints/default.nix b/lib/constraints/default.nix index 7fc080624..ed2764c8a 100644 --- a/lib/constraints/default.nix +++ b/lib/constraints/default.nix @@ -24,8 +24,8 @@ in "${moduleName}.${instanceName}.roles.${roleName}.min" = { assertion = memberCount >= roleConstraints.min; message = '' - The ${moduleName} module requires at least ${builtins.toString roleConstraints.min} '${roleName}'s - but found '${builtins.toString memberCount}' within instance '${instanceName}': + The ${moduleName} module requires at least ${builtins.toString roleConstraints.min} members of the '${roleName}' role + but found '${builtins.toString memberCount}' members within instance '${instanceName}': ${lib.concatLines members} ''; @@ -36,8 +36,8 @@ in "${moduleName}.${instanceName}.roles.${roleName}.max" = { assertion = memberCount <= roleConstraints.max; message = '' - The ${moduleName} module allows at most for ${builtins.toString roleConstraints.max} '${roleName}'s - but found '${builtins.toString memberCount}' within instance '${instanceName}': + The ${moduleName} module allows at most for ${builtins.toString roleConstraints.max} members of the '${roleName}' role + but found '${builtins.toString memberCount}' members within instance '${instanceName}': ${lib.concatLines members} '';