Commit Graph

3395 Commits (pr683)
 

Author SHA1 Message Date
Alex Willmer 70a6d0d7dc Get mitogen.fakessh module working again
Fixes include

- Setting cloexec flag on pipe files, using set_inheritable on sockets,
  and close_fds=False on subprocess.Popen to work around file
  descriptors not being inheritable by default in new versions of python

- Adding mitogen.exit_status variable and avoiding os.kill call so fake
  'ssh' script is able to exit cleanly with correct status code

- Fixing broken os.dup call in ExternalContext._setup_master when input
  and output streams have the same descriptor

- Updating fakessh module to do necessary python3 string/byte
  conversions, and use updated mitogen Protocol, Stream, and Router apis

- Simplifying fakessh startup sequence so there aren't unnecessary
  differences between ways control and data handles are passed, and ways
  master and slave processes are initialized

- Fixing shutdown race conditions where subprocess exit handling or
  stdin EOF handling could result in a truncated stdout stream

- Updating and adding a lot of docstrings and comments

- Adding Process.proc is None / is not None assertions to be clear about
  which parts of fakessh.Process code are specific to the slave process,
  and which parts are specific to the master process.

- Re-enabling unit test case and updating an outdated file path so it
  passes
3 years ago
Alex Willmer 89c0cc94d1
Merge pull request #923 from moreati/issue915
Fix [DEPRECATION WARNING]: The '_remote_checksum()' method is deprecated.
3 years ago
Alex Willmer 25ea6dde02 ansible_mitogen: Allow mitogen_fetch to bypass slurp module
This reapplies an earlier change, when this plugin was first introduced to
Mitogen. The plugin was updated to fix

[DEPRECATION WARNING]: The '_remote_checksum()' method is deprecated.

I've elected to short-circuit the if statemtn logic, rather than
deleting/unindenting, to make the code delta much smaller. This should make it
easier to maintain/update.

Fixes #915
3 years ago
Alex Willmer 0ff9c6e579 ansible_mitogen: Replace fetch action plug from upstream
From
be0cdc0ea2/lib/ansible/plugins/action/fetch.py
3 years ago
Alex Willmer 11a61acb32
Merge pull request #922 from moreati/functools.wraps
mitogen.utils: Preserve docstring of functions decorated @with_router
3 years ago
Alex Willmer e101cc4f44 mitogen.utils: Preserve docstring of functions decorated @with_router
Co-authored-by: Rezart Qelibari <gast-kontakt+mitogen@astzweig.de>

Replaces #837
Fixes #836
3 years ago
Alex Willmer a743e831c6
Merge pull request #921 from moreati/import-cleanups
Cleanup imports in mitogen, ansible_mitogen, & tests
3 years ago
Alex Willmer 31b3a4eb4a ansible_mitogen: Standardise __future__ imports to match Ansible
Some modules additionally enable unicode_literals (which Ansible doesn't do).
I've chosen not to change that, for now.
3 years ago
Alex Willmer 3dbb0e28ce tests: List leaked file descriptors 3 years ago
Alex Willmer 109feec6d5 Fix lints found by flake8 3 years ago
Alex Willmer 18c89de5a9 Remove unused module imports 3 years ago
Alex Willmer 566d75d82f
Merge pull request #920 from moreati/unittest-deprecations
Add Ansible podman connection support
3 years ago
Alex Willmer db9e52ce8e tests: Run containers on macOS with podman, instead of Docker 3 years ago
Alex Willmer 96e20a09d6 ansible_mitogen: Add podman connection plugin 3 years ago
Alex Willmer 0417d4d73a Replace os.system() with subprocess.check_call()
Non-zero return codes should raise an exception, not pass silently.
3 years ago
Alex Willmer 1287d58a54 Use with open(): ... to ensure file objects get closed 3 years ago
Alex Willmer 65809a6f0f mitogen: Handle Python 3.10 threading depreactions 3 years ago
Alex Willmer caa20be43e tests: Use TestCase.assertEqual()
assertEquals() is deperecated in unittest
3 years ago
Alex Willmer c4f1cc150d
Merge pull request #918 from moreati/python3.10
Python 3.10 support
3 years ago
Alex Willmer a8317c2393 tests: Remove unittest2, use stdlib unittest
unittest2 is incomplatible with Python 3.10
3 years ago
Alex Willmer 2a95d039ab Python 3.10 support 3 years ago
Alex Willmer af03b9a9b3
Merge pull request #917 from moreati/cleanups
Test and build improvements
3 years ago
Alex Willmer 104865e866 build: Remove declared support for Python<2.7
Master and the 0.3.x branch have never supported these versions, but we didn't
update the metadata.
3 years ago
Alex Willmer ccca77bcc0 tests: Fix old Ansible dependencies installed by Tox 3 years ago
Alex Willmer 63543b3b83 tests: Skip heavy & sudo Ansible tests by default
We don't wish to modify someone's local OS, or rely on them having sudo (with
or without password).
3 years ago
Alex Willmer c87976af40 tests: Fix lingering Python 2 isms 3 years ago
Alex Willmer c9318a26f6 tests: Suppress pip version warnings 3 years ago
Alex Willmer 491458673b tests: Manage ANSIBLE_STRATEGY with Tox 3 years ago
Alex Willmer 5805e30232 tests: Remove unused imports 3 years ago
Alex Willmer a167f164e4 tests.parent_test: Don't assume interpreter is in /usr/bin 3 years ago
Alex Willmer 7c4982ebee
Merge pull request #913 from willmerae/issue-906-minimal
master.ParentEnumerationMethod: Require matching pkg.__name__
3 years ago
Alex Willmer d2ca8a9423 master.ParentEnumerationMethod: Require matching pkg.__name__
Co-authored-by: Stefano Rivera <stefano@rivera.za.net>

When the requested module (e.g. ansible.module_utils.distro)
- is provided by another module *e.g. distro)
- that itself was a package (e.g. distro 1.7.0)

At runtime
- ansible/module_utils/distro/__init__.py executes
- if https://pypi.org/project/distro/ is present, it's loaded as
ansible.module_utils.distro
- otherwise ansible/module_utils/distro/_distro.py is loaded

ParentEnumerationMethod would wrongly use whatever was in
sys.modules['ansible.module_utils.distro]. Instead we should ascend to
the first parent that has fullname == sys.modules[fullname].__name__.
Then descend to the appropriate .py file on disk.

This bug didn't show up before because until distro 1.7.0 (Feb 2022) the
top-level distro module was a module (distro.py) not a package
(distro/__init__.py)

fixes #906
3 years ago
Alex Willmer 47699e15aa master.SysModulesMethod: log rejection reasons 3 years ago
Alex Willmer 0fa0a93f55 master.PkgutilMethod: log rejection reasons 3 years ago
Alex Willmer 60c4ae5599
Add notes on imports and importlib 3 years ago
Alex Willmer 5b8f7dd1be
Start v0.3.3 development 3 years ago
Alex Willmer e8c3fe7881
Fix Trove classifier, bump version
fixes #891

(cherry picked from commit 1a84184838)
3 years ago
Alex Willmer 5b505f524a
Merge pull request #884 from moreati/macos-11-again
Drop macOS 10.14 tests, explicitly test on macOS 11
3 years ago
Alex Willmer d424895344 ci: Drop Mac1014 jobs
The VM Image has been retired by Azure Pipelines.
3 years ago
Alex Willmer 77c306199c ci: Explicitly test on macOS-11 VM Image
As of writing this macOS-latest isn't quite yet upgraded, but warnings about
it are spewing out.
3 years ago
Alex Willmer 86b1fb0f49
Merge pull request #883 from Rosa-Luxemburgstiftung-Berlin/pr-ansible2.12
support for ansible 2.12
3 years ago
Klaus Zerwes f1fde91984 Revert "Revert "fixed tests for ansible 2.12""
This reverts commit ffb58cd557.
3 years ago
Klaus Zerwes 2b4f04c554 Revert "Revert "fixed tests for ansible 2.12""
This reverts commit 478f286efb.
3 years ago
Klaus Zerwes b8dd348b1e Revert "Revert "fixed tests for ansible 2.12""
This reverts commit f82bd3d714.
3 years ago
Klaus Zerwes 81f075340b use conditionals in list form 3 years ago
Klaus Zerwes ffb58cd557 Revert "fixed tests for ansible 2.12"
include is deprecated and will be removed in 2.16, so there is some time to fix this left
This reverts commit 19c28b2b1a.
3 years ago
Klaus Zerwes f82bd3d714 Revert "fixed tests for ansible 2.12"
include is deprecated and will be removed in 2.16, so there is some time to fix this left
This reverts commit 7bc2102d2b.
3 years ago
Klaus Zerwes 478f286efb Revert "fixed tests for ansible 2.12"
include is deprecated and will be removed in 2.16, so there is some time to fix this left
This reverts commit 2d3970552e.
3 years ago
Klaus Zerwes e509c1fb77
Update tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
3 years ago
Klaus Zerwes 54b9115f20
Update docs/ansible_detailed.rst
fixed supported ansible / python version listing

Co-authored-by: Alex Willmer <alex@moreati.org.uk>
3 years ago