Fix typos, enhance formatting, limit line length to 120

This commit is contained in:
Richard Vézina 2022-01-25 16:56:38 -05:00
commit cadc8438dc
7 changed files with 22 additions and 16 deletions

View file

@ -55,7 +55,7 @@ def mysql_connect(module, login_user=None, login_password=None, config_file='',
except Exception as e:
module.fail_json(msg="Failed to parse %s: %s" % (config_file, to_native(e)))
# Override some commond defaults with values from config file if needed
# Override some common defaults with values from config file if needed
if cp and cp.has_section('client'):
try:
module.params['login_host'] = cp.get('client', 'host', fallback=module.params['login_host'])

View file

@ -162,7 +162,7 @@ options:
type: str
version_added: '2.3.3'
seealso:
see also:
- module: community.mysql.mysql_info
- module: community.mysql.mysql_variables
- module: community.mysql.mysql_user
@ -335,7 +335,10 @@ import traceback
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.mysql.plugins.module_utils.database import mysql_quote_identifier
from ansible_collections.community.mysql.plugins.module_utils.mysql import mysql_connect, mysql_driver, mysql_driver_fail_msg, mysql_common_argument_spec
from ansible_collections.community.mysql.plugins.module_utils.mysql import (
mysql_connect, mysql_driver,
mysql_driver_fail_msg, mysql_common_argument_spec
)
from ansible.module_utils.six.moves import shlex_quote
from ansible.module_utils._text import to_native
@ -520,7 +523,7 @@ def db_import(module, host, user, password, db_name, target, all_databases, port
return p2.returncode, stdout2, stderr2
else:
# Used to prevent 'Broken pipe' errors that
# occasionaly occur when target files are compressed.
# occasionally occur when target files are compressed.
# FYI: passing the `shell=True` argument to p2 = subprocess.Popen()
# doesn't solve the problem.
cmd = " ".join(cmd)
@ -670,8 +673,8 @@ def main():
)
except Exception as e:
if os.path.exists(config_file):
module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or %s has the credentials. "
"Exception message: %s" % (config_file, to_native(e)))
module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or %s "
"has the credentials. Exception message: %s" % (config_file, to_native(e)))
else:
module.fail_json(msg="unable to find %s. Exception message: %s" % (config_file, to_native(e)))

View file

@ -184,7 +184,8 @@ engines:
returned: if not excluded by filter
type: dict
sample:
- { "CSV": { "Comment": "CSV storage engine", "Savepoints": "NO", "Support": "YES", "Transactions": "NO", "XA": "NO" } }
- { "CSV": { "Comment": "CSV storage engine", "Savepoints": "NO", "Support": "YES", "Transactions": "NO",
"XA": "NO" } }
master_status:
description: Master status information.
returned: if master
@ -196,7 +197,8 @@ slave_status:
returned: if standby
type: dict
sample:
- { "192.168.1.101": { "3306": { "replication_user": { "Connect_Retry": 60, "Exec_Master_Log_Pos": 769, "Last_Errno": 0 } } } }
- { "192.168.1.101": { "3306": { "replication_user": { "Connect_Retry": 60, "Exec_Master_Log_Pos": 769,
"Last_Errno": 0 } } } }
slave_hosts:
description: Slave status information.
returned: if master
@ -341,7 +343,7 @@ class MySQL_Info(object):
self.info['engines'][engine][vname] = val
def __convert(self, val):
"""Convert unserializable data."""
"""Convert un-serializable data."""
try:
if isinstance(val, Decimal):
val = float(val)
@ -564,8 +566,8 @@ def main():
check_hostname=check_hostname,
connect_timeout=connect_timeout, cursor_class='DictCursor')
except Exception as e:
module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or %s has the credentials. "
"Exception message: %s" % (config_file, to_native(e)))
module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or %s "
"has the credentials. Exception message: %s" % (config_file, to_native(e)))
###############################
# Create object and do main job

View file

@ -43,7 +43,8 @@ options:
- Where passed queries run in a single transaction (C(yes)) or commit them one-by-one (C(no)).
type: bool
default: no
seealso:
see also:
- module: community.mysql.mysql_db
author:
- Andrew Klychkov (@Andersson007)

View file

@ -188,7 +188,7 @@ extends_documentation_fragment:
- community.mysql.mysql
seealso:
see also:
- module: community.mysql.mysql_info
- name: MySQL replication reference
description: Complete reference of the MySQL replication documentation.

View file

@ -111,7 +111,7 @@ notes:
If you want to avoid this behavior, set I(set_default_role_all) to C(no).
- Supports C(check_mode).
seealso:
see also:
- module: community.mysql.mysql_user
- name: MySQL role reference
description: Complete reference of the MySQL role documentation.

View file

@ -415,8 +415,8 @@ def main():
connect_timeout=connect_timeout, check_hostname=check_hostname
)
except Exception as e:
module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or %s has the credentials. "
"Exception message: %s" % (config_file, to_native(e)))
module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or %s "
"has the credentials. Exception message: %s" % (config_file, to_native(e)))
if not sql_log_bin:
cursor.execute("SET SQL_LOG_BIN=0;")