mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-19 17:01:26 -07:00
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
This commit is contained in:
parent
8a17e43eae
commit
a1f419d541
3 changed files with 27 additions and 0 deletions
|
@ -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