Add PyMySQL python library for SQL Reporter support

It doens't have any other dependencies, but it's an optional depend for
Zuul itself, because plugins. Install it for the scheduler. Also,
provide an option flag to enable it.

Change-Id: I4cad419598ffefcdca5161664c6d073da37fb42f
This commit is contained in:
Monty Taylor 2017-07-27 13:44:18 -05:00
parent bdaeb08041
commit 98056b2c60
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 22 additions and 0 deletions

View File

@ -19,7 +19,29 @@ class zuul::scheduler (
$ensure = undef,
$layout_dir = '',
$manage_log_conf = true,
$python_version = 2,
$use_mysql = false,
) {
include ::pip
if ($use_mysql) {
if ($python_version == 3) {
include ::pip::python3
$pip_provider = pip3
$pip_command = 'pip3'
} else {
$pip_provider = openstack_pip
$pip_command = 'pip'
}
package { 'PyMySQL':
ensure => present,
provider => $pip_provider,
require => Class['pip'],
}
}
if ($::operatingsystem == 'Ubuntu') and ($::operatingsystemrelease >= '16.04') {
# This is a hack to make sure that systemd is aware of the new service
# before we attempt to start it.