mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-22 10:21:29 -07:00
fix returned value since get_resource_limit is used by other methods
This commit is contained in:
parent
367a528058
commit
9f34b926bf
3 changed files with 41 additions and 10 deletions
|
@ -552,15 +552,21 @@ class MySQL_Info(object):
|
|||
|
||||
resource_limits = get_resource_limits(self.module, self.cursor, user, host)
|
||||
|
||||
copy_ressource_limits = dict.copy(resource_limits)
|
||||
output_dict = {
|
||||
'user': user,
|
||||
'host': host,
|
||||
'privs': '/'.join(priv_string),
|
||||
'resource_limits': resource_limits
|
||||
'resource_limits': copy_ressource_limits
|
||||
}
|
||||
|
||||
if not resource_limits:
|
||||
del output_dict['resource_limits']
|
||||
# Prevent returning a resource limit if there is no value
|
||||
if resource_limits:
|
||||
for key, value in resource_limits.items():
|
||||
if value == 0:
|
||||
del output_dict['resource_limits'][key]
|
||||
if len(output_dict['resource_limits']) == 0:
|
||||
del output_dict['resource_limits']
|
||||
|
||||
output.append(output_dict)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue