diff --git a/plugins/module_utils/module.py b/plugins/module_utils/module.py index 6d1615b..16eae83 100644 --- a/plugins/module_utils/module.py +++ b/plugins/module_utils/module.py @@ -80,9 +80,7 @@ class AnsibleModule(object): if after_header is not None: diff["after_header"] = after_header else: - raise TypeError( - "only diff or before and after can be set, not both of them" - ) + raise TypeError("only diff or before and after can be set, not both of them") self.result["diff"].append(diff) def get(self, key: str, default: T = None) -> T: @@ -265,14 +263,10 @@ class SystemdUnitModule(AnsibleModule): def check(self): self.unitfile_gen() if not self.unitfile.exists(): - self.diff( - before="", after=self.unit(), before_header=self.unitfile.as_posix() - ) + self.diff(before="", after=self.unit(), before_header=self.unitfile.as_posix()) self.changed = True else: - if self.module.sha256(self.unitfile.as_posix()) != self.module.sha256( - (self.tmpdir / "newunit").as_posix() - ): + if self.module.sha256(self.unitfile.as_posix()) != self.module.sha256((self.tmpdir / "newunit").as_posix()): self.changed = True self.diff( before=self.unitfile.read_text(),