Skip to content

Commit

Permalink
Merge pull request #325 from dw/dmw
Browse files Browse the repository at this point in the history
Dmw
  • Loading branch information
dw committed Jul 26, 2018
2 parents 22e3335 + 441c60a commit 9fd135b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ansible_mitogen/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
20 changes: 13 additions & 7 deletions docs/ansible.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ write files.
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
--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::
Expand All @@ -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
<https://www.freelists.org/list/mitogen-announce>`_ in order to stay up to
date with new releases and important bug fixes.


Demo
~~~~
Expand Down Expand Up @@ -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.
Expand Down
20 changes: 16 additions & 4 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Release Notes
</style>


.. comment
v0.2.3 (2018-07-??)
-------------------
* `#315 <https://github.com/dw/mitogen/pull/315>`_: Mitogen for Ansible is
supported under Ansible 2.6. Contributed by `Dan Quackenbush
<https://github.com/danquack>`_.
v0.2.2 (2018-07-??)
-------------------

Expand All @@ -31,6 +41,12 @@ Mitogen for Ansible
network device connections, however it should still be possible to use device
connections while Mitogen is active.

* `#300 <https://github.com/dw/mitogen/issues/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 <https://github.com/dw/mitogen/pull/301>`_: variables like ``$HOME`` in
the ``remote_tmp`` setting are evaluated correctly.

Expand All @@ -42,10 +58,6 @@ Mitogen for Ansible
process environment cleanup, caused by the change in v0.2.1 to run local
tasks with the correct environment.

* `#315 <https://github.com/dw/mitogen/pull/315>`_: Mitogen for Ansible is
supported under Ansible 2.6. Contributed by `Dan Quackenbush
<https://github.com/danquack>`_.

* `#317 <https://github.com/dw/mitogen/issues/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
Expand Down
10 changes: 9 additions & 1 deletion mitogen/parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down

0 comments on commit 9fd135b

Please sign in to comment.