From 2f822fdae69c3bd16a540f0d88146fe7689c99e6 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 9 Oct 2015 17:25:10 +0100 Subject: [PATCH] Switch from MySQL-python to PyMySQL As part of the cross-project effort [1] to prepare OpenStack for Python3 as the primary Python version used, the decision has been made to switch from using MySQL-python to PyMySQL [2]. This patch switches all OpenStack Services to use the PyMySQL library. [1] https://etherpad.openstack.org/p/liberty-cross-project-python3 [2] https://review.openstack.org/184388 UpgradeImpact Implements: blueprint liberty-release Change-Id: I7532b5dd72cd2f682f1e4ffdf290b741c2185cb3 --- playbooks/roles/os_ceilometer/defaults/main.yml | 2 +- playbooks/roles/os_cinder/defaults/main.yml | 2 +- playbooks/roles/os_cinder/templates/cinder.conf.j2 | 2 +- playbooks/roles/os_glance/defaults/main.yml | 2 +- playbooks/roles/os_glance/templates/glance-api.conf.j2 | 2 +- playbooks/roles/os_glance/templates/glance-manage.conf.j2 | 2 +- playbooks/roles/os_glance/templates/glance-registry.conf.j2 | 2 +- playbooks/roles/os_heat/defaults/main.yml | 2 +- playbooks/roles/os_heat/templates/heat.conf.j2 | 2 +- playbooks/roles/os_horizon/defaults/main.yml | 2 +- playbooks/roles/os_keystone/defaults/main.yml | 2 +- playbooks/roles/os_keystone/templates/keystone.conf.j2 | 2 +- playbooks/roles/os_neutron/defaults/main.yml | 2 +- playbooks/roles/os_neutron/templates/neutron.conf.j2 | 2 +- .../roles/os_neutron/templates/plugins/plumgrid/plumgrid.ini.j2 | 2 +- playbooks/roles/os_nova/defaults/main.yml | 2 +- playbooks/roles/os_nova/templates/nova.conf.j2 | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/playbooks/roles/os_ceilometer/defaults/main.yml b/playbooks/roles/os_ceilometer/defaults/main.yml index d10c564c71..b35644d6d7 100644 --- a/playbooks/roles/os_ceilometer/defaults/main.yml +++ b/playbooks/roles/os_ceilometer/defaults/main.yml @@ -83,7 +83,7 @@ ceilometer_pip_packages: - ceilometer - python-ceilometerclient - ceilometermiddleware - - MySQL-python + - PyMySQL - python-memcached - pycrypto - warlock diff --git a/playbooks/roles/os_cinder/defaults/main.yml b/playbooks/roles/os_cinder/defaults/main.yml index 07c414979d..1414ac53ef 100644 --- a/playbooks/roles/os_cinder/defaults/main.yml +++ b/playbooks/roles/os_cinder/defaults/main.yml @@ -209,7 +209,7 @@ cinder_pip_packages: - ecdsa - httplib2 - keystonemiddleware - - MySQL-python + - PyMySQL - python-memcached - pycrypto - python-cinderclient diff --git a/playbooks/roles/os_cinder/templates/cinder.conf.j2 b/playbooks/roles/os_cinder/templates/cinder.conf.j2 index f99c288003..1c3a3b40b7 100644 --- a/playbooks/roles/os_cinder/templates/cinder.conf.j2 +++ b/playbooks/roles/os_cinder/templates/cinder.conf.j2 @@ -111,7 +111,7 @@ nfs_shares_config={{ cinder_nfs_client.nfs_shares_config }} {% endif %} [database] -connection = mysql://{{ cinder_galera_user }}:{{ cinder_container_mysql_password }}@{{ cinder_galera_address }}/{{ cinder_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ cinder_galera_user }}:{{ cinder_container_mysql_password }}@{{ cinder_galera_address }}/{{ cinder_galera_database }}?charset=utf8 [oslo_messaging_rabbit] rabbit_port = {{ rabbitmq_port }} diff --git a/playbooks/roles/os_glance/defaults/main.yml b/playbooks/roles/os_glance/defaults/main.yml index 2645d445df..5bba92ec5e 100644 --- a/playbooks/roles/os_glance/defaults/main.yml +++ b/playbooks/roles/os_glance/defaults/main.yml @@ -158,7 +158,7 @@ glance_apt_packages: glance_pip_packages: - glance - keystonemiddleware - - MySQL-python + - PyMySQL - python-memcached - pycrypto - python-glanceclient diff --git a/playbooks/roles/os_glance/templates/glance-api.conf.j2 b/playbooks/roles/os_glance/templates/glance-api.conf.j2 index adfd70da89..4e15443b7b 100644 --- a/playbooks/roles/os_glance/templates/glance-api.conf.j2 +++ b/playbooks/roles/os_glance/templates/glance-api.conf.j2 @@ -50,7 +50,7 @@ show_image_direct_url = {{ glance_show_image_direct_url }} task_executor = {{ glance_task_executor }} [database] -connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8 [keystone_authtoken] insecure = {{ keystone_service_internaluri_insecure | bool }} diff --git a/playbooks/roles/os_glance/templates/glance-manage.conf.j2 b/playbooks/roles/os_glance/templates/glance-manage.conf.j2 index 069a6e2674..453e7e71ee 100644 --- a/playbooks/roles/os_glance/templates/glance-manage.conf.j2 +++ b/playbooks/roles/os_glance/templates/glance-manage.conf.j2 @@ -5,4 +5,4 @@ log_file = /var/log/glance/glance-manage.log fatal_deprecations = {{ glance_fatal_deprecations }} [database] -connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8 diff --git a/playbooks/roles/os_glance/templates/glance-registry.conf.j2 b/playbooks/roles/os_glance/templates/glance-registry.conf.j2 index ac26de2498..4c60a4ad03 100644 --- a/playbooks/roles/os_glance/templates/glance-registry.conf.j2 +++ b/playbooks/roles/os_glance/templates/glance-registry.conf.j2 @@ -21,7 +21,7 @@ rpc_backend = {{ glance_rpc_backend }} {% endif %} [database] -connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8 [keystone_authtoken] insecure = {{ keystone_service_internaluri_insecure | bool }} diff --git a/playbooks/roles/os_heat/defaults/main.yml b/playbooks/roles/os_heat/defaults/main.yml index 434213c26f..81f297acb2 100644 --- a/playbooks/roles/os_heat/defaults/main.yml +++ b/playbooks/roles/os_heat/defaults/main.yml @@ -146,7 +146,7 @@ heat_apt_packages: heat_pip_packages: - keystonemiddleware - - MySQL-python + - PyMySQL - python-memcached - pycrypto - python-ceilometerclient diff --git a/playbooks/roles/os_heat/templates/heat.conf.j2 b/playbooks/roles/os_heat/templates/heat.conf.j2 index ec074fa2b6..c87ecf7ab5 100644 --- a/playbooks/roles/os_heat/templates/heat.conf.j2 +++ b/playbooks/roles/os_heat/templates/heat.conf.j2 @@ -40,7 +40,7 @@ endpoint_type = {{ heat_clients_endpoint }} endpoint_type = {{ heat_clients_heat_endpoint }} [database] -connection = mysql://{{ heat_galera_user }}:{{ heat_container_mysql_password }}@{{ heat_galera_address }}/{{ heat_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ heat_galera_user }}:{{ heat_container_mysql_password }}@{{ heat_galera_address }}/{{ heat_galera_database }}?charset=utf8 [ec2authtoken] auth_uri = {{ keystone_service_internalurl }} diff --git a/playbooks/roles/os_horizon/defaults/main.yml b/playbooks/roles/os_horizon/defaults/main.yml index 5b4ead935c..56cd86d51a 100644 --- a/playbooks/roles/os_horizon/defaults/main.yml +++ b/playbooks/roles/os_horizon/defaults/main.yml @@ -120,7 +120,7 @@ horizon_pip_packages: - greenlet - horizon - keystonemiddleware - - MySQL-python + - PyMySQL - oslo.config - ply - pycrypto diff --git a/playbooks/roles/os_keystone/defaults/main.yml b/playbooks/roles/os_keystone/defaults/main.yml index a147d5a830..a395ed72aa 100644 --- a/playbooks/roles/os_keystone/defaults/main.yml +++ b/playbooks/roles/os_keystone/defaults/main.yml @@ -340,7 +340,7 @@ keystone_pip_packages: - keystonemiddleware - ldappool - lxml - - MySQL-python + - PyMySQL - oslo.middleware - pbr - pycrypto diff --git a/playbooks/roles/os_keystone/templates/keystone.conf.j2 b/playbooks/roles/os_keystone/templates/keystone.conf.j2 index 60d1611458..7d43ac7933 100644 --- a/playbooks/roles/os_keystone/templates/keystone.conf.j2 +++ b/playbooks/roles/os_keystone/templates/keystone.conf.j2 @@ -52,7 +52,7 @@ methods = {{ keystone_auth_methods }} {% endif %} [database] -connection = mysql://{{ keystone_galera_user }}:{{ keystone_container_mysql_password }}@{{ keystone_galera_address }}/{{ keystone_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ keystone_galera_user }}:{{ keystone_container_mysql_password }}@{{ keystone_galera_address }}/{{ keystone_galera_database }}?charset=utf8 idle_timeout = {{ keystone_database_idle_timeout }} min_pool_size = {{ keystone_database_min_pool_size }} max_pool_size = {{ keystone_database_max_pool_size }} diff --git a/playbooks/roles/os_neutron/defaults/main.yml b/playbooks/roles/os_neutron/defaults/main.yml index fb16118573..9f0c7a932f 100644 --- a/playbooks/roles/os_neutron/defaults/main.yml +++ b/playbooks/roles/os_neutron/defaults/main.yml @@ -290,7 +290,7 @@ neutron_pip_packages: - configobj - cliff - keystonemiddleware - - MySQL-python + - PyMySQL - neutron - pycrypto - python-glanceclient diff --git a/playbooks/roles/os_neutron/templates/neutron.conf.j2 b/playbooks/roles/os_neutron/templates/neutron.conf.j2 index 9ee967bdb8..8c9e70e410 100644 --- a/playbooks/roles/os_neutron/templates/neutron.conf.j2 +++ b/playbooks/roles/os_neutron/templates/neutron.conf.j2 @@ -130,7 +130,7 @@ check_revocations_for_cached = False # Database [database] -connection = mysql://{{ neutron_galera_user }}:{{ neutron_container_mysql_password }}@{{ neutron_galera_address }}/{{ neutron_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ neutron_galera_user }}:{{ neutron_container_mysql_password }}@{{ neutron_galera_address }}/{{ neutron_galera_database }}?charset=utf8 max_overflow = {{ neutron_db_max_overflow }} max_pool_size = {{ neutron_db_pool_size }} pool_timeout = {{ neutron_db_pool_timeout }} diff --git a/playbooks/roles/os_neutron/templates/plugins/plumgrid/plumgrid.ini.j2 b/playbooks/roles/os_neutron/templates/plugins/plumgrid/plumgrid.ini.j2 index f5913e769e..bd494f3fe2 100644 --- a/playbooks/roles/os_neutron/templates/plugins/plumgrid/plumgrid.ini.j2 +++ b/playbooks/roles/os_neutron/templates/plugins/plumgrid/plumgrid.ini.j2 @@ -11,4 +11,4 @@ director_server_port={{ pg_ports['vip_port'] }} username={{ pg_username }} password={{ pg_password }} servertimeout=70 -connection = mysql://{{ neutron_galera_user }}:{{ neutron_container_mysql_password }}@{{ neutron_galera_address }}/{{ neutron_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ neutron_galera_user }}:{{ neutron_container_mysql_password }}@{{ neutron_galera_address }}/{{ neutron_galera_database }}?charset=utf8 diff --git a/playbooks/roles/os_nova/defaults/main.yml b/playbooks/roles/os_nova/defaults/main.yml index 8fbd313a39..8b63f629ec 100644 --- a/playbooks/roles/os_nova/defaults/main.yml +++ b/playbooks/roles/os_nova/defaults/main.yml @@ -355,7 +355,7 @@ nova_compute_kvm_apt_packages: # Common pip packages nova_pip_packages: - - MySQL-python + - PyMySQL - python-memcached - pycrypto - python-keystoneclient diff --git a/playbooks/roles/os_nova/templates/nova.conf.j2 b/playbooks/roles/os_nova/templates/nova.conf.j2 index f47043becf..ef3b26b920 100644 --- a/playbooks/roles/os_nova/templates/nova.conf.j2 +++ b/playbooks/roles/os_nova/templates/nova.conf.j2 @@ -219,7 +219,7 @@ check_revocations_for_cached = False {% if inventory_hostname not in groups['nova_compute'] %} [database] -connection = mysql://{{ nova_galera_user }}:{{ nova_container_mysql_password }}@{{ nova_galera_address }}/{{ nova_galera_database }}?charset=utf8 +connection = mysql+pymysql://{{ nova_galera_user }}:{{ nova_container_mysql_password }}@{{ nova_galera_address }}/{{ nova_galera_database }}?charset=utf8 max_overflow = {{ nova_db_max_overflow }} max_pool_size = {{ nova_db_max_pool_size }} pool_timeout = {{ nova_db_pool_timeout }}