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

Prepare for distutils.version being removed in Python 3.12 #599

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

Akasurde
Copy link
Member

SUMMARY

distutils has been deprecafed and will be removed from
Python's stdlib in Python 3.12 (see https://python.org/dev/peps/pep-0632).

This PR replaces the use of distutils.version.LooseVersion and distutils.version.StrictVersion
with LooseVersion from the vendored copy of distutils.version
included with ansible-core 2.12 (ansible/ansible#74644) if available,
and falls back to distutils.version for ansible-core 2.11 and before.

Since ansible-core 2.11 and earlier do not support Python 3.12 (since
they use LooseVersion itself in various places), this incomplete fix
should be OK for now. Also, the way this PR works (by adding a new
module_utils version that abstracts away where LooseVersion comes from),
it is easy to also fix this for ansible-core 2.11 and earlier later on.

Signed-off-by: Abhijeet Kasurde akasurde@redhat.com

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

changelogs/fragments/disutils.version.yml
plugins/module_utils/core.py
plugins/module_utils/version.py
plugins/modules/ec2.py

@Akasurde
Copy link
Member Author

cc @felixfontein @Andersson007

@Akasurde
Copy link
Member Author

recheck

@felixfontein
Copy link
Contributor

Please consider integrating ansible-collections/community.general#3984 into this PR.

distutils has been deprecafed and will be removed from
Python's stdlib in Python 3.12 (see https://python.org/dev/peps/pep-0632).

This PR replaces the use of distutils.version.LooseVersion and distutils.version.StrictVersion
with LooseVersion from the vendored copy of distutils.version
included with ansible-core 2.12 (ansible/ansible#74644) if available,
and falls back to distutils.version for ansible-core 2.11 and before.

Since ansible-core 2.11 and earlier do not support Python 3.12 (since
they use LooseVersion itself in various places), this incomplete fix
should be OK for now. Also, the way this PR works (by adding a new
module_utils version that abstracts away where LooseVersion comes from),
it is easy to also fix this for ansible-core 2.11 and earlier later on.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
@jillr
Copy link
Collaborator

jillr commented Jan 12, 2022

recheck

@jillr jillr added the gate label Jan 12, 2022
Copy link
Contributor

@ansible-zuul ansible-zuul bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ansible-zuul ansible-zuul bot merged commit 518fb17 into ansible-collections:main Jan 12, 2022
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
…type_param

Allow specifying topic type for SNS module.

SUMMARY
Adding a topic_type param to SNS module (simillar to SQS).
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
sns_topic module
ADDITIONAL INFORMATION
Simillar to SQS queues, SNS topics also allow specifying a type, that can either be 'Standard' or 'FIFO'. Furthermore if you have a FIFO SQS queue and want to subscribe that to an SNS topic, that one has to be FIFO too. Hence adding this flag is important and is actually just another option for the creat_topic action in Boto, see https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.create_topic

Reviewed-by: Stefan Horning <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants