From a29a883dfc4dafd530d47e83396e4606527a7d1a Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 25 Jul 2018 14:03:26 -0700 Subject: [PATCH 1/6] issue #311: docs: comment out Ansible 2.6 for now. --- docs/ansible.rst | 2 +- docs/changelog.rst | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/ansible.rst b/docs/ansible.rst index 8750aec11..0d0948f61 100644 --- a/docs/ansible.rst +++ b/docs/ansible.rst @@ -58,7 +58,7 @@ Installation ------------ 1. Thoroughly review the :ref:`noteworthy_differences` and :ref:`changelog`. -2. Verify Ansible 2.3-2.6.1 and Python 2.6, 2.7 or 3.6 are listed in ``ansible +2. Verify Ansible 2.3-2.5 and Python 2.6, 2.7 or 3.6 are listed in ``ansible --version`` output. 3. Download and extract |mitogen_url| from PyPI. 4. Modify ``ansible.cfg``: diff --git a/docs/changelog.rst b/docs/changelog.rst index 59fb2a5eb..8d9a17eda 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -15,6 +15,16 @@ Release Notes +.. comment + + v0.2.3 (2018-07-??) + ------------------- + + * `#315 `_: Mitogen for Ansible is + supported under Ansible 2.6. Contributed by `Dan Quackenbush + `_. + + v0.2.2 (2018-07-??) ------------------- @@ -42,10 +52,6 @@ Mitogen for Ansible process environment cleanup, caused by the change in v0.2.1 to run local tasks with the correct environment. -* `#315 `_: Mitogen for Ansible is - supported under Ansible 2.6. Contributed by `Dan Quackenbush - `_. - * `#317 `_: respect the verbosity setting when writing to to Ansible's ``log_path`` log file, if it is enabled. Child log filtering was also incorrect, causing the master to needlessly wake From bfe9f81d0b8cb789744d84473e6a322dbb671063 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 25 Jul 2018 16:37:49 -0700 Subject: [PATCH 2/6] ansible: fix RPC time logging. Rendering call arguemtns was broken for non-positional arguments. --- ansible_mitogen/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible_mitogen/connection.py b/ansible_mitogen/connection.py index 3be63bd48..c45a8aa70 100644 --- a/ansible_mitogen/connection.py +++ b/ansible_mitogen/connection.py @@ -593,8 +593,8 @@ def call(self, func, *args, **kwargs): try: return self.call_async(func, *args, **kwargs).get().unpickle() finally: - LOG.debug('Call took %d ms: %s%r', 1000 * (time.time() - t0), - func.__name__, args) + LOG.debug('Call took %d ms: %r', 1000 * (time.time() - t0), + mitogen.parent.CallSpec(func, args, kwargs)) def create_fork_child(self): """ From 3138982ef4e1a17bbc548a3d4830448f76e53c43 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 25 Jul 2018 22:11:43 -0700 Subject: [PATCH 3/6] docs: link mitogen-announce mailing list. --- docs/ansible.rst | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/ansible.rst b/docs/ansible.rst index 0d0948f61..37dfde1cc 100644 --- a/docs/ansible.rst +++ b/docs/ansible.rst @@ -57,11 +57,9 @@ write files. Installation ------------ -1. Thoroughly review the :ref:`noteworthy_differences` and :ref:`changelog`. -2. Verify Ansible 2.3-2.5 and Python 2.6, 2.7 or 3.6 are listed in ``ansible - --version`` output. -3. Download and extract |mitogen_url| from PyPI. -4. Modify ``ansible.cfg``: +1. Thoroughly review :ref:`noteworthy_differences` and :ref:`changelog`. +2. Download and extract |mitogen_url|. +3. Modify ``ansible.cfg``: .. parsed-literal:: @@ -74,12 +72,16 @@ Installation per-run basis. Like ``mitogen_linear``, the ``mitogen_free`` strategy exists to mimic the ``free`` strategy. -5. If targets have a restrictive ``sudoers`` file, add a rule like: +4. If targets have a restrictive ``sudoers`` file, add a rule like: -:: + :: deploy = (ALL) NOPASSWD:/usr/bin/python -c* +5. Subscribe to the `mitogen-announce mailing list + `_ in order to stay up to + date with new releases and important bug fixes. + Demo ~~~~ @@ -123,6 +125,10 @@ Testimonials Noteworthy Differences ---------------------- +* Ansible 2.3-2.5 are supported along with Python 2.6, 2.7 or 3.6. Verify your + installation is running one of these versions by checking ``ansible + --version`` output. + * The Ansible ``raw`` action executes as a regular Mitogen connection, precluding its use for installing Python on a target. This will be addressed soon. From 50a1bf6f2257f68700ebebb05cce4c9920e0942a Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 26 Jul 2018 09:30:12 -0700 Subject: [PATCH 4/6] issue #300: temporary workaround for shutdown issue. Closes #300. --- mitogen/parent.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mitogen/parent.py b/mitogen/parent.py index de8d893df..a62128eb7 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -531,7 +531,15 @@ def writers(self): def _control(self, fd, filters, flags): mitogen.core._vv and IOLOG.debug( '%r._control(%r, %r, %r)', self, fd, filters, flags) - self._changelist.append(select.kevent(fd, filters, flags)) + # TODO: at shutdown it is currently possible for KQ_EV_ADD/KQ_EV_DEL + # pairs to be pending after the associated file descriptor has already + # been closed. Fixing this requires maintaining extra state, or perhaps + # making fd closure the poller's responsibility. In the meantime, + # simply apply changes immediately. + # self._changelist.append(select.kevent(fd, filters, flags)) + changelist = [select.kevent(fd, filters, flags)] + events, _ = mitogen.core.io_op(self._kqueue.control, changelist, 0, 0) + assert not events def start_receive(self, fd, data=None): mitogen.core._vv and IOLOG.debug('%r.start_receive(%r, %r)', From 17c5bd26e1373a0fda89b6b1957a81479c2de32d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 26 Jul 2018 11:43:17 -0700 Subject: [PATCH 5/6] Update changelog. --- docs/changelog.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 8d9a17eda..f55ab6d80 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -41,6 +41,12 @@ Mitogen for Ansible network device connections, however it should still be possible to use device connections while Mitogen is active. +* `#300 `_: an exception could appear + on OS X during shutdown due to scheduling pending Kevent filter changes for + file descriptors that have already been closed before the IO loop resumes. As + a temporary workaround, Mitogen does not make use of Kevent's bulk change + feature. + * `#301 `_: variables like ``$HOME`` in the ``remote_tmp`` setting are evaluated correctly. From 441c60a3ca9a97681813a814a3e24608c55a6746 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 26 Jul 2018 11:55:04 -0700 Subject: [PATCH 6/6] Fix GitHub vulnerability notification. --- dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index 7527504ed..f093721bb 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -4,7 +4,7 @@ coverage==4.5.1 Django==1.6.11 # Last version supporting 2.6. mock==2.0.0 pytz==2012d # Last 2.6-compat version. -paramiko==2.3.1 # Last 2.6-compat version. +paramiko==2.3.2 # Last 2.6-compat version. pytest-catchlog==1.2.2 pytest==3.1.2 PyYAML==3.11; python_version < '2.7'