You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/lib/ansible/parsing
Martin Krizek eb29a662f6 Exceptions clean up (#85176)
* replace usage of `IOError` as it is an alias to `OSError`
* replace usage of `socket.error` as it is an alias to `OSError`
* use subclasses of `OSError` rather than inspecting `errno`s
* utilize `exist_ok` parameter of `os.makedirs` rather than ignoring
  `FileExistsError`

Make the following changes to the exception handling this patch already
updates to be consistent with the new code:
* use `ex` as a name for exception being handled
* use `from ex` when re-raising exception for additional context
* use f-strings and `!r` for quoting
* pass exceptions to the `exception` parameter of `fail_json`
* use `display.error_as_warning` rather than passing stringified
  exception into `display.warning`

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 600c1e67b4)
6 months ago
..
utils Clean up TE error handling, wrap sigalrm handler (#85232) 6 months ago
vault Exceptions clean up (#85176) 6 months ago
yaml Miscellaneous DT fixes (#84991) 8 months ago
__init__.py Require `from __future__ import annotations` (#81902) 2 years ago
ajson.py Resolve misc DTFIX0/1 (#85247) 6 months ago
dataloader.py Exceptions clean up (#85176) 6 months ago
mod_args.py DTFIX recategorization and error/warning refactor (#85181) 6 months ago
plugin_docs.py recategorize pass over DTFIX-MERGE entries post b4 (#85155) 7 months ago
quoting.py Update triple single quotes to triple double quotes (#84099) 1 year ago
splitter.py Templating overhaul, implement Data Tagging (#84621) 8 months ago