Changeset - bf5f072d9072
[Not reviewed]
0 1 0
Branko Majic (branko) - 6 years ago 2020-01-08 20:23:08
branko@majic.rs
MAR-148: Add a TODO entry for removing patched mysql.py file.
1 file changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
roles/database_server/module_utils/mysql.py
Show inline comments
 
# @TODO: This is a patched file used as workaround for issues around
 
# the use check_implicit_admin parameter for the mysql_user
 
# module. Once the fix has landed in official Ansible release, this
 
# file should be dropped. For more details see:
 
#
 
# - https://github.com/ansible/ansible/commit/47aea84924
 
# - https://github.com/ansible/ansible/issues/64560
 

	
 

	
 
# This code is part of Ansible, but is an independent component.
 
# This particular file snippet, and this file snippet only, is BSD licensed.
 
# Modules you write using this snippet, which is embedded dynamically by Ansible
 
# still belong to the author of the module, and may assign their own license
 
# to the complete work.
 
#
 
# Copyright (c), Jonathan Mainguy <jon@soh.re>, 2015
 
# Most of this was originally added by Sven Schliesing @muffl0n in the mysql_user.py module
 
# All rights reserved.
 
#
 
# Redistribution and use in source and binary forms, with or without modification,
 
# are permitted provided that the following conditions are met:
 
#
 
#    * Redistributions of source code must retain the above copyright
 
#      notice, this list of conditions and the following disclaimer.
 
#    * Redistributions in binary form must reproduce the above copyright notice,
 
#      this list of conditions and the following disclaimer in the documentation
 
#      and/or other materials provided with the distribution.
 
#
 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 

	
 
import os
 

	
 
try:
 
    import pymysql as mysql_driver
 
    _mysql_cursor_param = 'cursor'
 
except ImportError:
 
    try:
 
        import MySQLdb as mysql_driver
 
        import MySQLdb.cursors
 
        _mysql_cursor_param = 'cursorclass'
 
    except ImportError:
 
        mysql_driver = None
 

	
 
mysql_driver_fail_msg = 'The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required.'
 

	
 

	
 
def mysql_connect(module, login_user=None, login_password=None, config_file='', ssl_cert=None, ssl_key=None, ssl_ca=None, db=None, cursor_class=None,
 
                  connect_timeout=30):
 
    config = {}
0 comments (0 inline, 0 general)