mitogen-hq / mitogen

Distributed self-replicating programs in Python
https://mitogen.networkgenomics.com/
BSD 3-Clause "New" or "Revised" License
2.34k stars 199 forks source link

mitogen_sudo connection plugin and friends are the wrong plugin type for `get_option('become_...')` #1173

Open moreati opened 1 day ago

moreati commented 1 day ago

ansible_mitogen.plugins.connection contains 3 "connections" that aren't connections in the Ansible world view

In Ansible land these would be become plugins. This wasn't a problem, but may become a problem now. I'm moving the PlaybookSpec to Ansible's plugin options API, but the options become_exe and become_flags are associated with become plugins and these plugins are connection plugins.

As a result the tests in tests/ansible/integration/stub_connections/all.yml fail with

PLAY [integration/stub_connections/mitogen_sudo.yml] ***************************

TASK [include_tasks _raw_params=../_mitogen_only.yml] **************************
Monday 28 October 2024  21:22:28 +0000 (0:00:00.372)       0:09:28.173 ******** 
included: /home/runner/work/mitogen/mitogen/tests/ansible/integration/_mitogen_only.yml for target-centos7-1, target-centos8-2, target-debian9-3, target-debian10-4, target-debian11-5, target-ubuntu1604-6, target-ubuntu1804-7, target-ubuntu2004-8

TASK [meta _raw_params=end_play] ***********************************************
Monday 28 October 2024  21:22:28 +0000 (0:00:00.159)       0:09:28.333 ******** 
skipping: [target-centos7-1]

TASK [custom_python_detect_environment ] ***************************************
Monday 28 October 2024  21:22:28 +0000 (0:00:00.012)       0:09:28.345 ******** 
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'get_option'
fatal: [target-centos7-1]: FAILED! => 
  msg: 'Unexpected failure during module execution: ''NoneType'' object has no attribute ''get_option'''
  stdout: ''
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'get_option'
fatal: [target-centos8-2]: FAILED! => 
  msg: 'Unexpected failure during module execution: ''NoneType'' object has no attribute ''get_option'''
  stdout: ''
moreati commented 1 day ago

see #1172