From 200dbafb1c9046be87eaf014a4f34f0fd2d4983f Mon Sep 17 00:00:00 2001
From: portdirect <pete@port.direct>
Date: Thu, 17 Nov 2016 14:23:18 +0000
Subject: [PATCH] Update Barbican to use correct mysql connection string

PyMySQL is prefered to PythonMySQL for Sqlalchemy, as it provides
python3 support and is actively maintained, and is therefore the
currently recommended lib for db connections.
 * https://wiki.openstack.org/wiki/PyMySQL_evaluation

Kolla currently uses PyMySQL for all connections bar Barbican
(which works fine with PyMySQL): once this commit is merged it will
be possible to remove the PythonMySQL libs, and mysql libs for kolla
images (except kolla-toolbox).

TrivialFix

Change-Id: Id256387134ca551a181c5e49c9b6d63f62b72523
---
 ansible/roles/barbican/templates/barbican.conf.j2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ansible/roles/barbican/templates/barbican.conf.j2 b/ansible/roles/barbican/templates/barbican.conf.j2
index 55c6b22101..aef43567bd 100644
--- a/ansible/roles/barbican/templates/barbican.conf.j2
+++ b/ansible/roles/barbican/templates/barbican.conf.j2
@@ -11,7 +11,7 @@ max_allowed_secret_in_bytes = 10000
 max_allowed_request_size_in_bytes = 1000000
 
 db_auto_create = False
-sql_connection = mysql://{{ barbican_database_user }}:{{ barbican_database_password }}@{{ barbican_database_address }}/{{ barbican_database_name }}
+sql_connection = mysql+pymysql://{{ barbican_database_user }}:{{ barbican_database_password }}@{{ barbican_database_address }}/{{ barbican_database_name }}
 
 transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %}