add back function argument deleted during rebase

This commit is contained in:
Laurent Indermuehle 2023-10-03 14:50:31 +02:00
parent 6b4fbd1b99
commit 16ac592834
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09
3 changed files with 8 additions and 4 deletions

View file

@ -627,7 +627,7 @@ def sort_column_order(statement):
return '%s(%s)' % (priv_name, ', '.join(columns))
def privileges_unpack(priv, mode, ensure_usage=True):
def privileges_unpack(priv, mode, column_case_sensitive, ensure_usage=True):
""" Take a privileges string, typically passed as a parameter, and unserialize
it into a dictionary, the same format as privileges_get() above. We have this
custom format to avoid using YAML/JSON strings inside YAML playbooks. Example

View file

@ -967,7 +967,8 @@ def main():
detach_members=dict(type='bool', default=False),
check_implicit_admin=dict(type='bool', default=False),
set_default_role_all=dict(type='bool', default=True),
members_must_exist=dict(type='bool', default=True)
members_must_exist=dict(type='bool', default=True),
column_case_sensitive=dict(type='bool', default=False)
)
module = AnsibleModule(
argument_spec=argument_spec,
@ -1002,6 +1003,7 @@ def main():
db = ''
set_default_role_all = module.params['set_default_role_all']
members_must_exist = module.params['members_must_exist']
column_case_sensitive = module.params['column_case_sensitive']
if priv and not isinstance(priv, (str, dict)):
msg = ('The "priv" parameter must be str or dict '
@ -1051,7 +1053,7 @@ def main():
module.fail_json(msg=to_native(e))
try:
priv = privileges_unpack(priv, mode, ensure_usage=not subtract_privs)
priv = privileges_unpack(priv, mode, column_case_sensitive, ensure_usage=not subtract_privs)
except Exception as e:
module.fail_json(msg='Invalid privileges string: %s' % to_native(e))

View file

@ -411,6 +411,7 @@ def main():
resource_limits=dict(type='dict'),
force_context=dict(type='bool', default=False),
session_vars=dict(type='dict'),
column_case_sensitive=dict(type='bool', default=False)
)
module = AnsibleModule(
argument_spec=argument_spec,
@ -446,6 +447,7 @@ def main():
plugin_auth_string = module.params["plugin_auth_string"]
resource_limits = module.params["resource_limits"]
session_vars = module.params["session_vars"]
column_case_sensitive = module.params["column_case_sensitive"]
if priv and not isinstance(priv, (str, dict)):
module.fail_json(msg="priv parameter must be str or dict but %s was passed" % type(priv))
@ -485,7 +487,7 @@ def main():
mode = get_mode(cursor)
except Exception as e:
module.fail_json(msg=to_native(e))
priv = privileges_unpack(priv, mode, ensure_usage=not subtract_privs)
priv = privileges_unpack(priv, mode, column_case_sensitive, ensure_usage=not subtract_privs)
password_changed = False
if state == "present":
if user_exists(cursor, user, host, host_all):