Commit Graph

925 Commits (5ec61c90a664263f9849bf9d60b54c19a527ee67)

Author SHA1 Message Date
Alex Willmer 5ec61c90a6 docs: Fix website download link when there is a pre-release
The previous regex was incorrectly matching a prefix (e.g. 1.2.3) of a
pre-release (e.g. 1.2.3a1, 1.2.3rc1).

fixes #1276
6 months ago
Alex Willmer dd4b5755ef Continue 0.3.25dev 6 months ago
Alex Willmer bd774b7489 Prepare v0.3.25a1 6 months ago
Alex Willmer 208e37abef packaging: Handle pre-release __version__ tuples 6 months ago
Alex Willmer 0187418697 ansible_mitogen: alpha datatag handling & CI for Ansible 12 (ansible-core 2.19)
refs #1258
6 months ago
Alex Willmer e5a56a833c docs: Add Ansible 12 to support table 6 months ago
Stefano Rivera 8abafe8c8e Changelog entry for ansible 12 support 6 months ago
Alex Willmer 65a81121c5 Begin 0.3.25dev 6 months ago
Alex Willmer 229fd67e97 Prepare v0.3.24 6 months ago
Alex Willmer 6cec613daa mitogen: Only close stdio file descriptors that were open at process startup
File descriptors 0, 1, and 2 are usually stdin, stdout, stderr; but not
always. If a process is started without one of these then the first descriptor
allocated by the process opening a file or socket will be allocated an fd <=
STDERR_FILENO. This isn't common, but it does occur, e.g. Windows GUI apps
started without being connected to a console, controller side plugins run
under Ansible 12 (ansible-core 2.19).

In such cases the corresponding sys attribute (e.g. sys.stderr) will be None.

refs #1258

See also
- https://docs.python.org/3/library/sys.html#sys.__stdin__
- https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_12.html#porting-guide-for-v12-0-0a1
- https://github.com/ansible/ansible/pull/82770
- https://github.com/python/typeshed/issues/11778
- https://gist.github.com/moreati/034fef45f73d809d9411a8a63eca34d6
6 months ago
Alex Willmer c146682e2e Begin 0.3.24dev 7 months ago
Alex Willmer 8e25944c94 Prepare v0.3.23 7 months ago
Alex Willmer 4a75648774 packaging: Fix InvalidVersion in release versions
fixes #1263
7 months ago
Alex Willmer 27b4b77bba CI: Upgrade Github jobs from Ubuntu 20.04 to 22.04 & 24.04
Python 2.7 (distro package) and 3.6 (pyenv managed) jobs run on Ubuntu 22.04.
More recent Pythons (distro or Github provided) run on 24.04.

fixes #1256

Ansible tasks that run locally (e.g. `connection: local`, `delegate_to:
localhost`) must now specify their `ansible_python_interpreter`, typically as
`{{ ansible_playbook_python }}`; otherwise the system Python on the controller
(e.g. `/usr/bin/python`) is likely to be used and this is often outside the
version range supported by the Ansible verison under test. If this occurs then
the symptom is often a failure to import a builtin from
`ansible.module_utils.six.moves`, e.g.

```
fatal: [target-centos6-1]: FAILED! => changed=true
  cmd:
  - ansible
  - -m
  - shell
  - -c
  - local
  - -a
  - whoami
  - -i
  - /tmp/mitogen_ci_ansibled3llejls/hosts
  - test-targets
  delta: '0:00:02.076385'
  end: '2025-04-17 17:27:02.561500'
  msg: non-zero return code
  rc: 8
  start: '2025-04-17 17:27:00.485115'
  stderr: |-
  stderr_lines: <omitted>
  stdout: |-
    An exception occurred during task execution. To see the full traceback,
    use -vvv. The error was:     from ansible.module_utils.six.moves import
    map, reduce, shlex_quote
```
7 months ago
Alex Willmer f659213159 CI: Don't share temporary directory between test groupings
Each grouping gets an independant dir, e.g.
 - ansible -> /tmp/mitogen_ci_ansible
 - debops -> /tmp/mitogen_ci_debops

Importing ci_lib no longer creates a temporary directory as a side effect.
10 months ago
Alex Willmer 620bc3a944 CI: Don't copy SSH private key to temporary dir
Running tests aren't using the copy & it wasn't being cleaned up.
10 months ago
Alex Willmer 5283e6756b CI: Statically specify test usernames and group names
This makes it easier to grep for a username and to discover how the user was
create. Hence it should be easier to understand/debug tests.
10 months ago
Alex Willmer a0d3858ff9 packaging: Avoid ast module, requires Python = 2.6
fixes #1238, refs #1236
10 months ago
Alex Willmer 927fb172d8 mitogen: Log skipped termios attributes
refs #1121
10 months ago
Alex Willmer 657e40b982 Begin 0.3.23dev 10 months ago
Alex Willmer ae703b97a7 Prepare v0.3.22 10 months ago
Alex Willmer 9b91a1a529 ansible_mitogen: Fix TypeError in set_file_owner()
fixes #1234
10 months ago
Sergey Putko 186404829d
ansible_mitogen: Fix dnf module by patching include of dnf.cli (#1230)
* fix dnf module import

* add changelog
10 months ago
Alex Willmer f82c72f539 tests: Name transport_config tests that involve mitogen_via
This should make it much easier to find a (failed) test, based on test output.
10 months ago
Alex Willmer e97d20c9d1 ansible_mitogen: Return stderr_lines from _low_level_execute_command()
Vanilla Ansible has returned stderr since v1.9 or earlier, stderr_lines was
added in v2.6.0 (https://github.com/ansible/ansible/pull/40079).
10 months ago
Alex Willmer 51c7b789f7 ansible_mitogen: Decouple possible_pythons order & error handling
'python' could now be tried earlier, or not at all.
10 months ago
Alex Willmer 1b8b2c8b1a ansible_mitogen: Rename Mitogen interpreter discovery attributes
This makes their nature and ownership/responsibility much more explicit.
10 months ago
Alex Willmer d3da3ff769 ansible_mitogen: Don't redeclare interpreter discovery attributes
Duplicated effort on Ansible 2.10, and a potential source of future error
10 months ago
Alex Willmer 9342186b22 tests: Fix unclosed file in fd_check script 10 months ago
Alex Willmer 67219c309a mitogen: Fix unclosed file in first stage 10 months ago
Alex Willmer 6fcb7aae96 mitogen: Replace uses of deprecated `pkgutil.find_loader()`
fixes #1111
10 months ago
Alex Willmer 90779fe846 ci: Enable Python warnings 10 months ago
Alex Willmer 5c76941d1e Begin 0.3.22dev 11 months ago
Alex Willmer 8b7354cb3a Prepare v0.3.21 11 months ago
Alex Willmer 53b6bf0292 docs: Add changelog, credits for connection_loader__get fixes
refs #1215
11 months ago
Jarl Gullberg 0d1c84e727
Update changelog. 11 months ago
Alex Willmer 1195e39b55 docs: Read release version from changelog
fixes #1157
11 months ago
Alex Willmer 882dc0ca06 docs: Fix "No module named 'imghdr'" when building website
Between Mitogen 0.3.19 & 0.3.20 Netlify changed their default Python to 3.13.
This broke our deployment of https://mitogen.networkgenomics.com/. The
previous default was Python 3.8, based on a recent successful build of
https://spiffy-croissant-696d93.netlify.app.
11 months ago
Alex Willmer 3ee6a0ff93 Begin v0.3.21dev 11 months ago
Alex Willmer f1f8ad11ee Prepare v0.3.20 11 months ago
Alex Willmer 945e360363 ansible_mitogen: Respect interpreter_python and ANSIBLE_PYTHON_INTERPRETER
This adapts PR #740 by @extmind (afe0026890),
which augmented the call to `Connection.get_task_var()` with
`C.config.get_config_value('INTERPRETER_PYTHON'` as a default. Instead this
*replaces* the call to `Connection.get_task_var()`. The aim is greater
simplicity by disentangling templating of a configured interpreter path and
discovery of an interpreter when none is configured. I think this also reduces
the number of times `Connection._get_task_vars()` is called, so reducing the
number of times we do the ugly stack frame inspection.

I've also added test cases.

Co-authored-by: Lars Beckers <lars@extmind.de>
11 months ago
Alex Willmer 5e6d7bf4fb ansible_mitogen: Templated connection timeout
Ansible >= 4 (ansible-core >= 2.11) the SSH plugin has a `timeout` option and
with variable `ansible_ssh_timeout`, but not a `ansible_timeout` variable.
The local plugin has no such option or variable(s). However `ansible_timeout`
is backfilled for all conection plugins, by legacy mechanisms that populate
the play context attribute:
- `ansible.constants.COMMON_CONNECTION_VARS`
- `ansible.constants.MAGIC_VARIABLE_MAPPING`

The `timeout` keyword is for task completion timeout, not connection timeout.
12 months ago
Alex Willmer 6900e88dfd ansible_mitogen: Fix templated python interpreter with `meta: reset_connection`
refs #1079
12 months ago
Alex Willmer 53b4881628 ansible_mitogen: Fix wait_for_connection + templated ansible_python_interpreter
This tightens up our monkey patching `Connection._action` so it's only applied
during `meta: reset_connection` & promptly removed. This fixes "'int' object
has no attribute 'template'" when `ansible.plugins.action.wait_for_connection`
or other code calls `ansible.plugins.connection.ConnectionBase.reset()`.

This could also have switched to `templar=templar` on the temporary action,
rather than `templar=0`, but it's not strictly necessary to fix this bug. I
anticipate other changes doing so soon, to improve interpreter discovery &
templated python interpreter path support.
12 months ago
Alex Willmer ffb1709630 Begin v0.3.20dev 1 year ago
Alex Willmer 24ba734ff9 Prepare v0.3.19 1 year ago
Alex Willmer 0b99169f42 Support Ansible 11 (ansible-core 2.18) 1 year ago
Alex Willmer 1cd7ea18d3 Begin v0.3.19dev 1 year ago
Alex Willmer d85d9a25ee Prepare v0.3.18 1 year ago
Alex Willmer dd41ddf89b ansible_mitogen: Templated become flag
The code change to support this was already made in transport_config.py, as
part of templated become_user support (commit bf6607e27e, PR #1148). This
commit adds tests to confirm the functionality.
1 year ago