From aa1a4db56c1d6689f32d1a3cfec20527414d93ab Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Fri, 21 Apr 2023 20:56:16 +0200 Subject: [PATCH] added missing __unit cache --- plugins/modules/system_service.py | 1 + plugins/modules/target.py | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/modules/system_service.py b/plugins/modules/system_service.py index f1deb21..a7257f9 100644 --- a/plugins/modules/system_service.py +++ b/plugins/modules/system_service.py @@ -43,6 +43,7 @@ class Module(SystemdUnitModule): def prepare(self): self.unitfile = (SYSTEMD_SERVICE_CONFIG / self.get("name")).with_stem(".service") + self.__unit = None if self.get("type", "simple") != "oneshot" and len(self.get("start")) > 1: self.module.fail_json("only oneshot services are allowed to have multiple start commands", **self.result) diff --git a/plugins/modules/target.py b/plugins/modules/target.py index 61335a9..3461ef7 100644 --- a/plugins/modules/target.py +++ b/plugins/modules/target.py @@ -25,6 +25,7 @@ class Module(SystemdUnitModule): def prepare(self): self.unitfile = (SYSTEMD_SERVICE_CONFIG/ self.get("name")).with_stem(".target") + self.__unit = None def header(self) -> str: section = super().header()