Advertisement
Guest User

Untitled

a guest
Apr 19th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. From af325e478578e34fad99a46a95b9fd0213f28bd1 Mon Sep 17 00:00:00 2001 [7/1837]
  2. From: mvgrimes <mgrimes@cpan.org>
  3. Date: Fri, 11 Mar 2016 11:14:48 -0500
  4. Subject: [PATCH 1/2] Dynamically add ssl key to the mysql config hash iff
  5. needed
  6.  
  7. Just including the `ssl` key in the config for MySQLdb.connect, causes it to check for the existence of SSL support.
  8. This patch only adds the key if one of the ssl configuration options is included.
  9. ---
  10. lib/ansible/module_utils/mysql.py | 7 ++++---
  11. 1 file changed, 4 insertions(+), 3 deletions(-)
  12.  
  13. diff --git a/lib/ansible/module_utils/mysql.py b/lib/ansible/module_utils/mysql.py
  14. index 48e00ad..17430a5 100644
  15. --- a/lib/ansible/module_utils/mysql.py
  16. +++ b/lib/ansible/module_utils/mysql.py
  17. @@ -31,11 +31,12 @@
  18.  
  19. def mysql_connect(module, login_user=None, login_password=None, config_file='', ssl_cert=None, ssl_key=None, ssl_ca=
  20. None, db=None, cursor_class=None):
  21. config = {
  22. - 'host': module.params['login_host'],
  23. - 'ssl': {
  24. - }
  25. + 'host': module.params['login_host']
  26. }
  27.  
  28. + if ssl_ca is not None or ssl_key is not None or ssl_cert is not None:
  29. + config['ssl'] = {}
  30. +
  31. if module.params['login_unix_socket']:
  32. config['unix_socket'] = module.params['login_unix_socket']
  33. else:
  34. --
  35. 2.5.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement