Skip to content

Commit 5f63b84

Browse files
authored
Merge pull request #240 from jouvin/systemd_schema_fix
ncm-systemd schema: port fix from configuration-module-core/main
2 parents 5f34fc4 + f79adf6 commit 5f63b84

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

components/systemd/schema.pan

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,13 @@ type systemd_component = {
546546
# escaped full unitnames are allowed (or use shortnames and type)
547547
"unit" ? systemd_unit_type{}
548548
} with {
549-
foreach(name; unit; SELF["unit"]) {
550-
if (unit["type"] == "mount" && exists(unit["file"]) && exists(unit["file"]["config"]["mount"])) {
551-
goodname = systemd_make_mountunit(unit["file"]["config"]["mount"]["Where"]);
552-
if(goodname != name) {
553-
error('Incorrect name for mount unit, the name must match Where: %s vs %s', name, goodname);
549+
if (is_defined(SELF["unit"])) {
550+
foreach(name; unit; SELF["unit"]) {
551+
if (unit["type"] == "mount" && exists(unit["file"]) && exists(unit["file"]["config"]["mount"])) {
552+
goodname = systemd_make_mountunit(unit["file"]["config"]["mount"]["Where"]);
553+
if(goodname != name) {
554+
error('Incorrect name for mount unit, the name must match Where: %s vs %s', name, goodname);
555+
};
554556
};
555557
};
556558
};

0 commit comments

Comments
 (0)