mirror of https://github.com/ansible/ansible.git
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.
* 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
|
7 months ago | |
|---|---|---|
| .. | ||
| __init__.py | 10 years ago | |
| test__log_invocation.py | 2 years ago | |
| test__symbolic_mode_to_octal.py | 2 years ago | |
| test_argument_spec.py | 9 months ago | |
| test_atomic_move.py | 7 months ago | |
| test_command_nonexisting.py | 7 months ago | |
| test_dict_converters.py | 9 months ago | |
| test_exit_json.py | 9 months ago | |
| test_filesystem.py | 9 months ago | |
| test_get_available_hash_algorithms.py | 2 years ago | |
| test_get_file_attributes.py | 2 years ago | |
| test_get_module_path.py | 9 months ago | |
| test_heuristic_log_sanitize.py | 9 months ago | |
| test_imports.py | 9 months ago | |
| test_log.py | 2 years ago | |
| test_no_log.py | 9 months ago | |
| test_platform_distribution.py | 2 years ago | |
| test_run_command.py | 2 years ago | |
| test_safe_eval.py | 1 year ago | |
| test_sanitize_keys.py | 1 year ago | |
| test_selinux.py | 9 months ago | |
| test_set_cwd.py | 9 months ago | |
| test_set_mode_if_different.py | 2 years ago | |
| test_tmpdir.py | 9 months ago | |