Skip to content

Commit

Permalink
postgresql_ext: sort list of available versions (#1078)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
snopoke and Andersson007 authored Oct 13, 2020
1 parent f7656ac commit 159f38f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- postgresql_ext - fix version selection when ``version=latest`` (https://github.com/ansible-collections/community.general/pull/1078).
2 changes: 1 addition & 1 deletion plugins/modules/database/postgresql/postgresql_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 159f38f

Please sign in to comment.