mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-10-24 04:54:02 -07:00
[stable-2] mysql_info: fix TypeError failure when there are databases that do not contain tables (#205) (#208)
* mysql_info: fix TypeError failure when there are databases that do not contain tables (#205) * mysql_info: fix TypeError failure when there are databases that do not contain tables * Add changelog fragment (cherry picked from commita1f419d541) * Fix sanity errors (#206) (cherry picked from commit8a17e43eae)
This commit is contained in:
parent
2508c420ce
commit
77bd3bfa2e
4 changed files with 28 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ def sanitize_requires(tls_requires):
|
|||
if tls_requires:
|
||||
for key in tls_requires.keys():
|
||||
sanitized_requires[key.upper()] = tls_requires[key]
|
||||
if any([key in ["CIPHER", "ISSUER", "SUBJECT"] for key in sanitized_requires.keys()]):
|
||||
if any(key in ["CIPHER", "ISSUER", "SUBJECT"] for key in sanitized_requires.keys()):
|
||||
sanitized_requires.pop("SSL", None)
|
||||
sanitized_requires.pop("X509", None)
|
||||
return sanitized_requires
|
||||
|
|
|
|||
|
|
@ -474,6 +474,9 @@ class MySQL_Info(object):
|
|||
self.info['databases'][db['name']] = {}
|
||||
|
||||
if not exclude_fields or 'db_size' not in exclude_fields:
|
||||
if db['size'] is None:
|
||||
db['size'] = 0
|
||||
|
||||
self.info['databases'][db['name']]['size'] = int(db['size'])
|
||||
|
||||
# If empty dbs are not needed in the returned dict, exit from the method
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue