From 48642dd1d72f5cde6017a9c6ab97e0403febdda1 Mon Sep 17 00:00:00 2001 From: Strix <660956+MrStrix@users.noreply.github.com> Date: Wed, 6 Feb 2019 07:53:16 +0100 Subject: [PATCH] Copy/Paste error for ssl_ca (#51614) * Copy/Paste error for ssl_ca Whe `ssl_ca` is specified, the variable `ssl_cert` is checked. This is wrong * fix connection over host/port --- lib/ansible/modules/database/mysql/mysql_db.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/database/mysql/mysql_db.py b/lib/ansible/modules/database/mysql/mysql_db.py index 4f5e79e1971..206bf6f93a0 100644 --- a/lib/ansible/modules/database/mysql/mysql_db.py +++ b/lib/ansible/modules/database/mysql/mysql_db.py @@ -143,7 +143,7 @@ def db_dump(module, host, user, password, db_name, target, all_databases, port, cmd += " --ssl-cert=%s" % pipes.quote(ssl_cert) if ssl_key is not None: cmd += " --ssl-key=%s" % pipes.quote(ssl_key) - if ssl_cert is not None: + if ssl_ca is not None: cmd += " --ssl-ca=%s" % pipes.quote(ssl_ca) if socket is not None: cmd += " --socket=%s" % pipes.quote(socket) @@ -190,14 +190,14 @@ def db_import(module, host, user, password, db_name, target, all_databases, port cmd.append("--user=%s" % pipes.quote(user)) if password: cmd.append("--password=%s" % pipes.quote(password)) - if socket is not None: - cmd.append("--socket=%s" % pipes.quote(socket)) if ssl_cert is not None: cmd.append("--ssl-cert=%s" % pipes.quote(ssl_cert)) if ssl_key is not None: cmd.append("--ssl-key=%s" % pipes.quote(ssl_key)) - if ssl_cert is not None: + if ssl_ca is not None: cmd.append("--ssl-ca=%s" % pipes.quote(ssl_ca)) + if socket is not None: + cmd.append("--socket=%s" % pipes.quote(socket)) else: cmd.append("--host=%s" % pipes.quote(host)) cmd.append("--port=%i" % port)