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) (#1084)

* 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>
(cherry picked from commit 159f38f4f2)

Co-authored-by: Simon Kelly <skelly@dimagi.com>
This commit is contained in:
patchback[bot] 2020-10-13 14:53:17 +03:00 committed by GitHub
parent 2cb3cec659
commit ee8f87412a
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.