Skip to content
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

new helper function : normalize_boto3_result #271

Merged
merged 3 commits into from
Mar 10, 2021

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Feb 28, 2021

SUMMARY

We have a number of modules using JSON round-tripping to convert dates into ISO-formatted strings. Move this into a common helper.

Right now this only does something unusual to datetime resources, but it's been left generic in case something else is needed (Booleans?)

Todo:

  • Changelog
  • Unit tests
ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

plugins/module_utils/core.py

ADDITIONAL INFORMATION

@ansibullbot ansibullbot added WIP Work in progress module_utils module_utils needs_triage new_plugin New plugin plugins plugin (any type) labels Feb 28, 2021
@ansibullbot ansibullbot removed the new_plugin New plugin label Feb 28, 2021
@tremble tremble requested a review from jillr February 28, 2021 20:40
@tremble
Copy link
Contributor Author

tremble commented Feb 28, 2021

@jillr Stealing the logic from multiple community modules (because I need it in yet another one):

  • ec2_customer_gateway_info
  • ec2_vpc_endpoint
  • ec2_vpc_endpoint_info
  • ec2_vpc_peering_info
  • ec2_vpc_vpn_info
  • ec2_vpc_nat_gateway_info

Before I sit down and write unit tests, any objections?

@ansibullbot ansibullbot added the tests tests label Mar 7, 2021
@tremble tremble changed the title [WIP] new helper function : normalize_boto3_result function new helper function : normalize_boto3_result function Mar 7, 2021
@tremble tremble changed the title new helper function : normalize_boto3_result function new helper function : normalize_boto3_result Mar 7, 2021
@ansibullbot ansibullbot added community_review and removed WIP Work in progress labels Mar 7, 2021
@jillr
Copy link
Collaborator

jillr commented Mar 9, 2021

@tremble I like the idea of this, I've run across it several times recently myself. I see the unit test but wanted to be sure that's what your previous comment referred to - is this one ready?

@tremble
Copy link
Contributor Author

tremble commented Mar 10, 2021

This is ready for review. I initially pushed this before my first absence this month and wanted to get your opinion on pulling this code into module_utils.

Decided to just get the unit tests written in the end. They're not 100% comprehensive, but they can be expanded if we find gaps.

@jillr jillr merged commit c4bcc88 into ansible-collections:main Mar 10, 2021
@tremble tremble deleted the boto3_normalize branch May 28, 2021 07:08
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
Ansible 2.9 has a test constraint for openshift >= 0.6.2, < 0.9.0.
We're only specifying a minimum boto3 today and 1.16.x has released,
which pulls in a newer urllib3 than that openshift supports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review module_utils module_utils plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants