postgresql_privs - fix sort comparison (#65125)

The result of .sort() is None, not the sorted object. The comparison was comparing the result of the .sort() method and not the sorted values.
This commit is contained in:
Sam Doran 2019-11-20 18:26:30 -05:00 committed by GitHub
parent 6a763d7133
commit 426e37ea92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- postgresql_privs - sort results before comparing so that the values are compared and not the result of ``.sort()`` (https://github.com/ansible/ansible/pull/65125)

View file

@ -780,7 +780,9 @@ class Connection(object):
executed_queries.append(query)
self.cursor.execute(query)
status_after = get_status(objs)
return status_before.sort() != status_after.sort()
status_before.sort()
status_after.sort()
return status_before != status_after
class QueryBuilder(object):