]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
module_utils/ca_common: Add optional diff argument to exit_module
authorMathias Chapelain <mathias.chapelain@proton.ch>
Fri, 4 Feb 2022 18:33:18 +0000 (19:33 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 16 Feb 2022 08:44:36 +0000 (09:44 +0100)
Add optional `diff` argument defaulting to `{ "before": "", "after": ""}`.

Signed-off-by: Mathias Chapelain <mathias.chapelain@proton.ch>
module_utils/ca_common.py

index 9ea1f887d3667f1e0b066029a72a90dc68afd7e3..a0ab9cc8675ad72c3130966908fbef67d418af17 100644 (file)
@@ -84,7 +84,7 @@ def exec_command(module, cmd, stdin=None):
     return rc, cmd, out, err
 
 
-def exit_module(module, out, rc, cmd, err, startd, changed=False):
+def exit_module(module, out, rc, cmd, err, startd, changed=False, diff=dict(before="", after="")):
     endd = datetime.datetime.now()
     delta = endd - startd
 
@@ -97,6 +97,7 @@ def exit_module(module, out, rc, cmd, err, startd, changed=False):
         stdout=out.rstrip("\r\n"),
         stderr=err.rstrip("\r\n"),
         changed=changed,
+        diff=diff
     )
     module.exit_json(**result)