Bugfix of 65761: postgresql_privs fail after it's updated to 2.9.2 (#65903)

* Bugfix of 65761: postgresql_privs fail after it's updated to 2.9.2

* add changelog

(cherry picked from commit 9b85a51c64)
pull/66383/head
Andrew Klychkov 5 years ago committed by Matt Clay
parent e6405715c8
commit 13031109aa

@ -0,0 +1,2 @@
bugfixes:
- postgresql_privs - fix sorting lists with None elements for python3 (https://github.com/ansible/ansible/issues/65761).

@ -749,8 +749,16 @@ class Connection(object):
executed_queries.append(query) executed_queries.append(query)
self.cursor.execute(query) self.cursor.execute(query)
status_after = get_status(objs) status_after = get_status(objs)
status_before.sort()
status_after.sort() def nonesorted(e):
# For python 3+ that can fail trying
# to compare NoneType elements by sort method.
if e is None:
return ''
return e
status_before.sort(key=nonesorted)
status_after.sort(key=nonesorted)
return status_before != status_after return status_before != status_after

Loading…
Cancel
Save