Skip to content

Commit e632310

Browse files
committed
no tmpdir to remove for old ansible versions in fetch command
1 parent 74b7934 commit e632310

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ansible_mitogen/plugins/action/mitogen_fetch.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ def run(self, tmp=None, task_vars=None):
157157
result.update(dict(changed=False, md5sum=local_md5, file=source, dest=dest, checksum=local_checksum))
158158

159159
finally:
160-
self._remove_tmp_path(self._connection._shell.tmpdir)
160+
try:
161+
self._remove_tmp_path(self._connection._shell.tmpdir)
162+
except AttributeError:
163+
# .tmpdir was added to ShellModule in v2.6.0, so old versions don't have it
164+
pass
161165

162166
return result

0 commit comments

Comments
 (0)