Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From af325e478578e34fad99a46a95b9fd0213f28bd1 Mon Sep 17 00:00:00 2001 [7/1837]
- From: mvgrimes <mgrimes@cpan.org>
- Date: Fri, 11 Mar 2016 11:14:48 -0500
- Subject: [PATCH 1/2] Dynamically add ssl key to the mysql config hash iff
- needed
- Just including the `ssl` key in the config for MySQLdb.connect, causes it to check for the existence of SSL support.
- This patch only adds the key if one of the ssl configuration options is included.
- ---
- lib/ansible/module_utils/mysql.py | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
- diff --git a/lib/ansible/module_utils/mysql.py b/lib/ansible/module_utils/mysql.py
- index 48e00ad..17430a5 100644
- --- a/lib/ansible/module_utils/mysql.py
- +++ b/lib/ansible/module_utils/mysql.py
- @@ -31,11 +31,12 @@
- 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):
- config = {
- - 'host': module.params['login_host'],
- - 'ssl': {
- - }
- + 'host': module.params['login_host']
- }
- + if ssl_ca is not None or ssl_key is not None or ssl_cert is not None:
- + config['ssl'] = {}
- +
- if module.params['login_unix_socket']:
- config['unix_socket'] = module.params['login_unix_socket']
- else:
- --
- 2.5.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement