From f79adf6ebecd956170f9159bd2848f222d5c5d66 Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Tue, 17 Dec 2024 22:27:28 +0100 Subject: [PATCH] ncm-systemd schema: port fix from configuration-module-core/main - Fix ncm-systemd schema validation, see https://github.com/quattor/configuration-modules-core/issues/1787 - Manually ported in this repo to allow test-library CI script to succed --- components/systemd/schema.pan | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/systemd/schema.pan b/components/systemd/schema.pan index 90edb4c74..db1dab50c 100644 --- a/components/systemd/schema.pan +++ b/components/systemd/schema.pan @@ -546,11 +546,13 @@ type systemd_component = { # escaped full unitnames are allowed (or use shortnames and type) "unit" ? systemd_unit_type{} } with { - foreach(name; unit; SELF["unit"]) { - if (unit["type"] == "mount" && exists(unit["file"]) && exists(unit["file"]["config"]["mount"])) { - goodname = systemd_make_mountunit(unit["file"]["config"]["mount"]["Where"]); - if(goodname != name) { - error('Incorrect name for mount unit, the name must match Where: %s vs %s', name, goodname); + if (is_defined(SELF["unit"])) { + foreach(name; unit; SELF["unit"]) { + if (unit["type"] == "mount" && exists(unit["file"]) && exists(unit["file"]["config"]["mount"])) { + goodname = systemd_make_mountunit(unit["file"]["config"]["mount"]["Where"]); + if(goodname != name) { + error('Incorrect name for mount unit, the name must match Where: %s vs %s', name, goodname); + }; }; }; };