From 548d2a51ea686396b391b9ce0eb92aceec5e2c92 Mon Sep 17 00:00:00 2001 From: Sayan Paul Date: Fri, 15 Mar 2024 12:14:26 +0530 Subject: [PATCH] stage/unit-create:new systemd unit config params Added new systemd unit config : ConditionPathIsDirectory Signed-off-by: Sayan Paul --- stages/org.osbuild.systemd.unit.create | 7 +++++++ test/data/stages/systemd.unit.create/b.json | 3 +++ test/data/stages/systemd.unit.create/b.mpp.yaml | 3 +++ 3 files changed, 13 insertions(+) diff --git a/stages/org.osbuild.systemd.unit.create b/stages/org.osbuild.systemd.unit.create index 1662fea5..f562896f 100755 --- a/stages/org.osbuild.systemd.unit.create +++ b/stages/org.osbuild.systemd.unit.create @@ -15,6 +15,7 @@ of options: - 'Unit' section - 'Description' - string - 'ConditionPathExists' - string + - 'ConditionPathIsDirectory' - string - 'DefaultDependencies' - bool - 'Requires' - [strings] - 'Wants' - [strings] @@ -90,6 +91,12 @@ SCHEMA = r""" "type": "string" } }, + "ConditionPathIsDirectory": { + "type": "array", + "items": { + "type": "string" + } + }, "DefaultDependencies": { "type": "boolean" } diff --git a/test/data/stages/systemd.unit.create/b.json b/test/data/stages/systemd.unit.create/b.json index 8586dae7..c8536607 100644 --- a/test/data/stages/systemd.unit.create/b.json +++ b/test/data/stages/systemd.unit.create/b.json @@ -624,6 +624,9 @@ "DefaultDependencies": false, "ConditionPathExists": [ "|!/etc/myfile" + ], + "ConditionPathIsDirectory": [ + "|!/etc/mydir" ] }, "Service": { diff --git a/test/data/stages/systemd.unit.create/b.mpp.yaml b/test/data/stages/systemd.unit.create/b.mpp.yaml index 8586dae7..c8536607 100644 --- a/test/data/stages/systemd.unit.create/b.mpp.yaml +++ b/test/data/stages/systemd.unit.create/b.mpp.yaml @@ -624,6 +624,9 @@ "DefaultDependencies": false, "ConditionPathExists": [ "|!/etc/myfile" + ], + "ConditionPathIsDirectory": [ + "|!/etc/mydir" ] }, "Service": {