From e632310fc42f56c269d6b877b7de13b30cd29a4c Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Fri, 15 May 2020 14:55:48 -0700 Subject: [PATCH] no tmpdir to remove for old ansible versions in fetch command --- ansible_mitogen/plugins/action/mitogen_fetch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible_mitogen/plugins/action/mitogen_fetch.py b/ansible_mitogen/plugins/action/mitogen_fetch.py index 1844efd8..b9eece76 100644 --- a/ansible_mitogen/plugins/action/mitogen_fetch.py +++ b/ansible_mitogen/plugins/action/mitogen_fetch.py @@ -157,6 +157,10 @@ class ActionModule(ActionBase): result.update(dict(changed=False, md5sum=local_md5, file=source, dest=dest, checksum=local_checksum)) finally: - self._remove_tmp_path(self._connection._shell.tmpdir) + try: + self._remove_tmp_path(self._connection._shell.tmpdir) + except AttributeError: + # .tmpdir was added to ShellModule in v2.6.0, so old versions don't have it + pass return result