Skip to content

Commit 39f5ecb

Browse files
committed
Merge remote-tracking branch 'origin/dmw'
* origin/dmw: issue #558: disable test on OSX to cope with boundless mediocrity issue #558, #582: preserve remote tmpdir if caller did not supply one
2 parents 41d8a8a + 206a8d4 commit 39f5ecb

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

ansible_mitogen/mixins.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,10 @@ def _execute_module(self, module_name=None, module_args=None, tmp=None,
360360
)
361361
)
362362

363-
if ansible.__version__ < '2.5' and delete_remote_tmp and \
364-
getattr(self._connection._shell, 'tmpdir', None) is not None:
363+
if tmp and ansible.__version__ < '2.5' and delete_remote_tmp:
365364
# Built-in actions expected tmpdir to be cleaned up automatically
366365
# on _execute_module().
367-
self._remove_tmp_path(self._connection._shell.tmpdir)
366+
self._remove_tmp_path(tmp)
368367

369368
return result
370369

docs/changelog.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ Mitogen for Ansible
9393
default soft limit, allowing *"too many open files"* errors to be avoided
9494
more often in large runs without user configuration.
9595

96+
* `#558 <https://github.com/dw/mitogen/issues/558>`_,
97+
`#582 <https://github.com/dw/mitogen/issues/582>`_: on Ansible 2.3 a remote
98+
directory was unconditionally deleted after the first module belonging to an
99+
action plug-in had executed, causing the ``unarchive`` module to fail.
100+
96101
* `#578 <https://github.com/dw/mitogen/issues/578>`_: the extension could crash
97102
while rendering an error message, due to an incorrect format string.
98103

@@ -223,6 +228,7 @@ bug reports, testing, features and fixes in this release contributed by
223228
`Dave Cottlehuber <https://github.com/dch>`_,
224229
`Denis Krienbühl <https://github.com/href>`_,
225230
`El Mehdi CHAOUKI <https://github.com/elmchaouki>`_,
231+
`Florent Dutheil <https://github.com/fdutheil>`_,
226232
`James Hogarth <https://github.com/hogarthj>`_,
227233
`Marc Hartmayer <https://github.com/marc1006>`_,
228234
`Nigel Metheringham <https://github.com/nigelm>`_,
@@ -235,8 +241,10 @@ bug reports, testing, features and fixes in this release contributed by
235241
`Yuki Nishida <https://github.com/yuki-nishida-exa>`_,
236242
`@alexhexabeam <https://github.com/alexhexabeam>`_,
237243
`@DavidVentura <https://github.com/DavidVentura>`_,
244+
`@dbiegunski <https://github.com/dbiegunski>`_,
238245
`@ghp-rr <https://github.com/ghp-rr>`_,
239-
`@rizzly <https://github.com/rizzly>`_, and
246+
`@rizzly <https://github.com/rizzly>`_,
247+
`@SQGE <https://github.com/SQGE>`_, and
240248
`@tho86 <https://github.com/tho86>`_.
241249

242250

tests/ansible/regression/all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
- include: issue_154__module_state_leaks.yml
99
- include: issue_177__copy_module_failing.yml
1010
- include: issue_332_ansiblemoduleerror_first_occurrence.yml
11+
- include: issue_558_unarchive_failed.yml
1112
- include: issue_590__sys_modules_crap.yml
1213
- include: issue_591__setuptools_cwd_crash.yml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# _execute_module() would unconditionally delete shell.tmpdir without
2+
# respecting the passed in 'tmp' parameter on Ansible 2.3.
3+
4+
- name: regression/issue_558_unarchive_failed.yml
5+
hosts: test-targets
6+
tasks:
7+
- file: state=absent path=/tmp/foo
8+
- file: state=directory path=/tmp/foo
9+
- unarchive:
10+
src: "{{git_basedir}}/tests/data/unarchive_test.tar"
11+
dest: /tmp/foo
12+
# garbage doesn't work with BSD tar
13+
when: ansible_system != 'Darwin'

tests/data/unarchive_test.tar

10 KB
Binary file not shown.

0 commit comments

Comments
 (0)