forked from ansible-collections/amazon.aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor rds instance (ansible-collections#2119)
SUMMARY This is an initial refactor PR for rds modules, focusing on documentation and shared boto3 client functionality in rds module_utils, rds_instance_info, and rds_instance. First PR for ansible-collections#2003 / https://issues.redhat.com/browse/ACA-1343. COMPONENT NAME rds_instance_info rds_instance module_utils/rds.py ADDITIONAL INFORMATION Detailed summary of all the changes: module_utils/rds.py: Add RDS error class and handler Add describe_db_instances(), describe_db_snapshots(), and list_tags_for_resource() functions to handle boto3 client call Refactor get_tags() to use new list_tags_for_resource() function Add type hinting and function docstrings rds_instance_info module: Replace internal error handler and _describe_db_instances() functions with calls to new functions from module_utils/rds.py Remove extra boto3 call to retrieve tags for resource and just reformat instance TagList attribute since it is always returned by describe_db_instances Update instance_info() function return value for clarity Add type hinting and function docstrings Remove unit tests for functions no longer in module Refactor remaining unit tests to match updated instance_info() function rds_instance module: Refactor internal get_instance() function to use describe_db_instances() from module_utils/rds.py, remove extra boto3 call to get resource tags, and remove manual retry logic Refactor internal get_final_snapshot() function to use describe_db_snapshots() from module_utils/rds.py Add type hinting and function docstrings, and in some cases inline comments to explain complex logic Add unit tests for refactored functions Reviewed-by: Alina Buzachis Reviewed-by: Helen Bailey <[email protected]> Reviewed-by: Mandar Kulkarni <[email protected]> Reviewed-by: Mike Graves <[email protected]> Reviewed-by: Bikouo Aubin Reviewed-by: Mark Chappell
- Loading branch information
1 parent
7edc0ef
commit 5874643
Showing
6 changed files
with
677 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
minor_changes: | ||
- module_utils/rds.py - Refactor shared boto3 client functionality, add type hinting and function docstrings (https://github.com/ansible-collections/amazon.aws/pull/2119). | ||
- rds_instance - Refactor shared boto3 client functionality, add type hinting and function docstrings (https://github.com/ansible-collections/amazon.aws/pull/2119). | ||
- rds_instance_info - Refactor shared boto3 client functionality, add type hinting and function docstrings (https://github.com/ansible-collections/amazon.aws/pull/2119). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.