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/test/units/module_utils/facts
Martin Krizek 600c1e67b4
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>
6 months ago
..
fixtures facts: add facts about x86_64 flags to detect microarchitecture (#83356) 2 years ago
hardware facts: use pagesize for darwin (#84779) 9 months ago
network Update triple single quotes to triple double quotes (#84099) 1 year ago
other Update triple single quotes to triple double quotes (#84099) 1 year ago
system Improve SUSE distribution detection using VARIANT_ID with fallback (#85152) 7 months ago
virtual Coverage for virtual/sunos.py (#84357) 1 year ago
__init__.py Facts Timeout was not settable via ansible.cfg 9 years ago
base.py Remove Python 2.x compat from unit tests (#82109) 2 years ago
test_ansible_collector.py Cover unit tests with mypy (#84084) 1 year ago
test_collector.py test: update tests (#83686) 1 year ago
test_collectors.py Remove unused unit test code (#82168) 2 years ago
test_date_time.py 🔥 Remove Python 2 datetime compat fallbacks 9 months ago
test_facts.py Typo fixes and other bits and bobs (#83672) 1 year ago
test_sysctl.py Exceptions clean up (#85176) 6 months ago
test_timeout.py Fixed broken tests (#84088) 1 year ago
test_utils.py Remove Python 2.x compat from unit tests (#82109) 2 years ago