-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor rds instance #2119
Refactor rds instance #2119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! needs quick rebase
74246f6
to
b2c2ddf
Compare
recheck |
recheck |
recheck |
b2c2ddf
to
1133fe4
Compare
regate |
Build failed (gate pipeline). For information on how to proceed, see https://ansible.softwarefactory-project.io/zuul/buildset/c73d8c6a970448c5b1c2eef6eadffeab ✔️ ansible-galaxy-importer SUCCESS in 5m 04s |
regate |
recheck |
recheck |
Build failed.
|
recheck |
Changes to module_utils/rds.py: - Add RDS error class and handler - Add describe_db_instances() and list_tags_for_resource() functions - Refactor get_tags() to use list_tags_for_resource() and add detailed docstring Changes to 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 get 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 detailed docstring to instance_info function Changes to rds_instance_info unit tests: - Remove tests for functions no longer in module - Refactor remaining tests to match updated instance_info functions
Changes to module_utils/rds.py: - Add describe_db_snapshots() function using RDS error handler Changes to 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 tests for refactored functions
1133fe4
to
646c521
Compare
a7b9cac
into
ansible-collections:main
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
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
, andrds_instance
. First PR for #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:
rds_instance_info module:
_describe_db_instances()
functions with calls to new functions from module_utils/rds.pyTagList
attribute since it is always returned bydescribe_db_instances
instance_info()
function return value for clarityinstance_info()
functionrds_instance module:
get_instance()
function to usedescribe_db_instances()
from module_utils/rds.py, remove extra boto3 call to get resource tags, and remove manual retry logicget_final_snapshot()
function to usedescribe_db_snapshots()
from module_utils/rds.py