From 2d3c48207be9b1d40671946f64c660becba4f9cc Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 25 Mar 2024 15:14:07 +0100 Subject: [PATCH] stages/systemd.unit.create: comment for allow_no_value Add a comment explaining why we need to set allow_no_value=True for the configparser. --- stages/org.osbuild.systemd.unit.create | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stages/org.osbuild.systemd.unit.create b/stages/org.osbuild.systemd.unit.create index 38e7e18f..f4c78181 100755 --- a/stages/org.osbuild.systemd.unit.create +++ b/stages/org.osbuild.systemd.unit.create @@ -13,6 +13,9 @@ def main(tree, options): raise ValueError(f"Error: the {filename} service exceeds the maximum filename length.") cfg = options["config"] + + # We trick configparser into letting us write multiple instances of the same option by writing them as keys with no + # value, so we enable allow_no_value config = configparser.ConfigParser(allow_no_value=True) # prevent conversion of the option name to lowercase config.optionxform = lambda option: option