1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

postgresql_ext: sort list of available versions (#1078)

* 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 <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
Simon Kelly 2020-10-13 11:36:23 +02:00 committed by GitHub
parent f7656ac0d3
commit 159f38f4f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- postgresql_ext - fix version selection when ``version=latest`` (https://github.com/ansible-collections/community.general/pull/1078).

View file

@ -295,7 +295,7 @@ def ext_get_versions(cursor, ext):
if current_version == '0':
current_version = False
return (current_version, available_versions)
return (current_version, sorted(available_versions, key=LooseVersion))
# ===========================================
# Module execution.