diff --git a/lib/ansible/modules/extras/system/cronvar.py b/lib/ansible/modules/extras/system/cronvar.py index 244bcd63da..baa206888b 100644 --- a/lib/ansible/modules/extras/system/cronvar.py +++ b/lib/ansible/modules/extras/system/cronvar.py @@ -150,7 +150,7 @@ class CronVar(object): self.lines = f.read().splitlines() f.close() except IOError: - e = get_exception + e = get_exception() # cron file does not exist return except: @@ -207,7 +207,7 @@ class CronVar(object): os.unlink(self.cron_file) return True except OSError: - e = get_exception + e = get_exception() # cron file does not exist return False except: diff --git a/lib/ansible/modules/extras/system/crypttab.py b/lib/ansible/modules/extras/system/crypttab.py index e8e0b5835f..ea9698a12c 100644 --- a/lib/ansible/modules/extras/system/crypttab.py +++ b/lib/ansible/modules/extras/system/crypttab.py @@ -130,7 +130,7 @@ def main(): crypttab = Crypttab(path) existing_line = crypttab.match(name) except Exception: - e = get_exception + e = get_exception() module.fail_json(msg="failed to open and parse crypttab file: %s" % e, **module.params) diff --git a/lib/ansible/modules/extras/system/getent.py b/lib/ansible/modules/extras/system/getent.py index ba0d006146..995ba01514 100644 --- a/lib/ansible/modules/extras/system/getent.py +++ b/lib/ansible/modules/extras/system/getent.py @@ -114,7 +114,7 @@ def main(): try: rc, out, err = module.run_command(cmd) except Exception: - e = get_exception + e = get_exception() module.fail_json(msg=str(e)) msg = "Unexpected failure!" diff --git a/lib/ansible/modules/extras/system/gluster_volume.py b/lib/ansible/modules/extras/system/gluster_volume.py index 1f96827115..f7fae04129 100644 --- a/lib/ansible/modules/extras/system/gluster_volume.py +++ b/lib/ansible/modules/extras/system/gluster_volume.py @@ -150,7 +150,7 @@ def run_gluster(gargs, **kwargs): if rc != 0: module.fail_json(msg='error running gluster (%s) command (rc=%d): %s' % (' '.join(args), rc, out or err)) except Exception: - e = get_exception + e = get_exception() module.fail_json(msg='error running gluster (%s) command: %s' % (' '.join(args), str(e))) return out