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

postgresql_ext: sort list of available versions #1078

Merged
merged 4 commits into from
Oct 13, 2020

Conversation

snopoke
Copy link
Contributor

@snopoke snopoke commented Oct 12, 2020

SUMMARY

If version == 'latest' then the version is set to available_versions[-1] however available_versions was not previously sorted so the ordering was the natural order of the pg_available_extension_versions view.

This PR sorts the version using LooseVersion so that the version taken is in fact the latest available version.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

postgresql_ext

If `version == 'latest'` then the version is set to `available_versions[-1]` however `available_versions` was not previously sorted so the ordering was the natural order of the `pg_available_extension_versions` view.
@Andersson007
Copy link
Contributor

@snopoke thanks for the PR!
LGTM, also please

  1. add a changelog fragment https://docs.ansible.com/ansible/devel/community/development_process.html#changelogs-how-to
  2. fix sanity errors

@ansibullbot
Copy link
Collaborator

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/database/postgresql/postgresql_ext.py:298:60: unnecessary-lambda: Lambda may not be necessary

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/database/postgresql/postgresql_ext.py:298:60: unnecessary-lambda: Lambda may not be necessary

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/database/postgresql/postgresql_ext.py:298:60: unnecessary-lambda: Lambda may not be necessary

click here for bot help

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI and removed needs_triage labels Oct 12, 2020
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Oct 12, 2020
Co-authored-by: Andrew Klychkov <[email protected]>
Copy link
Contributor

@Andersson007 Andersson007 left a comment

Choose a reason for hiding this comment

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

LGTM

@Andersson007 Andersson007 merged commit 159f38f into ansible-collections:main Oct 13, 2020
@Andersson007
Copy link
Contributor

@snopoke thanks for the fix!

patchback bot pushed a commit that referenced this pull request Oct 13, 2020
* sort list of available versions

If `version == 'latest'` then the version is set to `available_versions[-1]` however `available_versions` was not previously sorted so the ordering was the natural order of the `pg_available_extension_versions` view.

* remove unnecessary lambda

* create changelog fragment for #1078

* add PR link to changelog fragment

Co-authored-by: Andrew Klychkov <[email protected]>

Co-authored-by: Andrew Klychkov <[email protected]>
(cherry picked from commit 159f38f)
@snopoke snopoke deleted the patch-1 branch October 13, 2020 09:47
Andersson007 pushed a commit that referenced this pull request Oct 13, 2020
* sort list of available versions

If `version == 'latest'` then the version is set to `available_versions[-1]` however `available_versions` was not previously sorted so the ordering was the natural order of the `pg_available_extension_versions` view.

* remove unnecessary lambda

* create changelog fragment for #1078

* add PR link to changelog fragment

Co-authored-by: Andrew Klychkov <[email protected]>

Co-authored-by: Andrew Klychkov <[email protected]>
(cherry picked from commit 159f38f)

Co-authored-by: Simon Kelly <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review database module module new_contributor Help guide this first time contributor plugins plugin (any type) postgresql small_patch Hopefully easy to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants