mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-04 05:04:22 -07:00
Merge pull request #1023 from lorin/postgres-user-fix
Fix postgresql_user bug
This commit is contained in:
commit
335f136e71
1 changed files with 11 additions and 9 deletions
|
@ -115,6 +115,8 @@ def get_database_privileges(cursor, user, db):
|
||||||
query = 'SELECT datacl FROM pg_database WHERE datname = %s'
|
query = 'SELECT datacl FROM pg_database WHERE datname = %s'
|
||||||
cursor.execute(query, (db,))
|
cursor.execute(query, (db,))
|
||||||
datacl = cursor.fetchone()[0]
|
datacl = cursor.fetchone()[0]
|
||||||
|
if datacl is None:
|
||||||
|
return []
|
||||||
r = re.search('%s=(C?T?c?)/[a-z]+\,?' % user, datacl)
|
r = re.search('%s=(C?T?c?)/[a-z]+\,?' % user, datacl)
|
||||||
if r is None:
|
if r is None:
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue