some formatting
Dieser Commit ist enthalten in:
Ursprung
bbf9daa8a7
Commit
53057c18a2
|
@ -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(),
|
||||
|
|
Laden…
In neuem Issue referenzieren