Skip to content

Commit

Permalink
ncm-systemd: Only validate units if they are present
Browse files Browse the repository at this point in the history
  • Loading branch information
jrha authored and jouvin committed Dec 12, 2024
1 parent ec20d0d commit 5af00cf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ncm-systemd/src/main/pan/components/systemd/schema.pan
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,13 @@ type ${project.artifactId}_component = {
# escaped full unitnames are allowed (or use shortnames and type)
"unit" ? ${project.artifactId}_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);
};
};
};
};
Expand Down

0 comments on commit 5af00cf

Please sign in to comment.