Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
This pull request enhances error handling and logging in the tools/utils/repo.py module. It also adds corresponding tests and updates the changelog.
Changes
Replaced print statements with logging using log for consistency.
Added specific exception handling for ClientError, NoCredentialsError, and PartialCredentialsError.
Updated CHANGELOG.md to document these changes.
Created tests/test_repo.py to add tests for the logging functionality using caplog.
Testing
Verified that the get_repo_json_file_contents function handles different exceptions correctly and logs appropriate messages.
Ensured that the changes do not affect the existing functionality.
Added tests that use caplog to check that logging occurs as expected during different scenarios.
Additional Notes
These changes aim to improve the robustness and maintainability of the code, making it easier to debug and understand. The logging ensures that detailed information is available when issues arise, facilitating quicker resolution.
Summary
This pull request enhances error handling and logging in the
tools/utils/repo.py
module. It also adds corresponding tests and updates the changelog.Changes
log
for consistency.ClientError
,NoCredentialsError
, andPartialCredentialsError
.CHANGELOG.md
to document these changes.tests/test_repo.py
to add tests for the logging functionality usingcaplog
.Testing
get_repo_json_file_contents
function handles different exceptions correctly and logs appropriate messages.caplog
to check that logging occurs as expected during different scenarios.Additional Notes
These changes aim to improve the robustness and maintainability of the code, making it easier to debug and understand. The logging ensures that detailed information is available when issues arise, facilitating quicker resolution.