* Use display.error_as_warning instead of self.warning
* Use display.error_as_warning instead of display.warning_as_error.
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
* Prevents callback handle_exception from displaying the captured exception when the task is not failed.
* Added tests.
Co-authored-by: Matt Clay <matt@mystile.com>
* Add AnsiballZ debugging support with debugpy
Adds support for debugging AnsiballZ modules with debugpy which is used
by VSCode as its Python debugger DAP. Debugging can either be done
through a manual Debugpy listening server through a launch.json
configuration or through the new ansible-test --dev-debug-on-deman
argument.
* Fix up integration test
* Simplify config option and move mypy ignore
* Use new API if available and fix typo
* Guard the import of debugpy
* Fix sanity import issue
* Minor cosmetic adjustments
* Simplify debugger setup
* ansible-test - Refactor debugging interface
* Add ansible-test debug integration tests
* Fix ansible-test shell when in unsupported dir
---------
Co-authored-by: Matt Clay <matt@mystile.com>
* meta: clear_host_errors, clarify what this applies to
It clears host for selection, but does not change state in the current iterator.
* also update example
Fix ssh plugin host variables. Variable names should conform to Python variable naming rules.
, and not contain characters like "[" or "]".
Update unit test
* Test expect module for missing pexpect
* Test expect module for incorrect timeout type
* Test expect module for out of date pexpect failures
* Test pexpect.ExceptionPexpect
Also fixed task naming to be inline with the rest of the file.
* Change pexpect management to venv
* Normalize b_out to b'' when falsy for consistent handling
* Move test venv from /tmp/ to output_dir
* Update tests according to corrections
* Remove break_system_packages when installing pexpect 3.3
* Remove unnecessary if statement
pexpect.run(...) shouldn't ever return None, so it's safe
to remove the check entirely. Maintains 100% coverage
* Mark dependent packages as auto which are installed as part of
deb file installation
Fixes: #78123
Co-authored-by: Matt Clay <matt@mystile.com>
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
* ansible-doc: print where the description is missing
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
* Short-circuit legacy network module prefix->action mapping
* Modified a non-short-circuit compound conditional in a legacy networking path that attempted to resolve an action for any module name containing `_`. The bug was always present, but the typical presentation (an ImportError) was ignored prior to 2.19.
* The legacy networking path should be deprecated and removed in 2.20- a module could still be run under the wrong action if one with a matching prefix is found.
* unit test fix
* Limit askpass prompts to single attempt
OpenSSH client option NumberOfPasswordPrompts defaults to 3 so in case
an incorrect connection password is provided it is excessively tried 3
times. Not only that but running the `_ssh_askpass` entry point multiple
times (via ssh) results in `json.decoder.JSONDecodeError` as after the
first run the shared memory is zero'd and the subsequent runs end up
calling `json.loads` on empty data.
`json.decoder.JSONDecodeError` does not happen prior to Python 3.13 as
the share memory is unlinked automatically on `.close()` and the
`_ssh_askpass` entry point exits with return code 1 before attempting to
load zero'd memory.
Fixes#85359
* changelog and tests
* Update changelogs/fragments/85359-askpass-incorrect-password-retries.yml
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
* Update lib/ansible/cli/_ssh_askpass.py
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
* Avoid race condition in second unlink
---------
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>