mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-19 00:41:28 -07:00
postgresql_privs: fix module fails when passing roles containing hyphens (#1059)
* postgresql_privs: fix module fails when passing roles containing hyphens * fix * Improve testing * Improve testing * Add changelog fragment * Improve testing * fix CI Free BSD
This commit is contained in:
parent
e3e66a57ec
commit
434b83170a
3 changed files with 99 additions and 3 deletions
|
@ -772,7 +772,7 @@ class Connection(object):
|
|||
# set_what: SQL-fragment specifying what to set for the target roles:
|
||||
# Either group membership or privileges on objects of a certain type
|
||||
if obj_type == 'group':
|
||||
set_what = ','.join('"%s"' % i for i in obj_ids)
|
||||
set_what = ','.join(obj_ids)
|
||||
elif obj_type == 'default_privs':
|
||||
# We don't want privs to be quoted here
|
||||
set_what = ','.join(privs)
|
||||
|
@ -1154,7 +1154,7 @@ def main():
|
|||
|
||||
except Error as e:
|
||||
conn.rollback()
|
||||
module.fail_json(msg=e.message, exception=traceback.format_exc())
|
||||
module.fail_json(msg=to_native(e), exception=traceback.format_exc())
|
||||
|
||||
except psycopg2.Error as e:
|
||||
conn.rollback()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue