Use full path for test in cloud::database::sql::mysql

At the moment it is not possible to use cloud::database::sql::mysql
on CentOS 7 because of the following error when trying to call the
binary 'test' in 'bootstrap-mysql'.

'test -d /var/lib/mysql/mysql' is not qualified and no path was
specified. Please qualify the command or specify a path.

Change-Id: I937ee32400da3f9c6154bc75ae8897e5c44dfab2
This commit is contained in:
Christian Berendt 2015-03-20 16:42:24 +01:00
parent 40cffd6fcf
commit 8f9d4130bc
2 changed files with 2 additions and 2 deletions

View File

@ -358,7 +358,7 @@ class cloud::database::sql::mysql (
# but MariaDB is not packaged for Red Hat / CentOS 7 in MariaDB repository.
exec { 'bootstrap-mysql':
command => '/usr/bin/mysql_install_db --rpm --user=mysql',
unless => 'test -d /var/lib/mysql/mysql',
unless => '/usr/bin/test -d /var/lib/mysql/mysql',
before => Service['mysqld'],
require => [Package[$mysql_server_package_name], File[$mysql_server_config_file]]
}

View File

@ -222,7 +222,7 @@ describe 'cloud::database::sql::mysql' do
it 'configure mysql database' do
is_expected.to contain_exec('bootstrap-mysql').with(
:command => '/usr/bin/mysql_install_db --rpm --user=mysql',
:unless => "test -d /var/lib/mysql/mysql",
:unless => "/usr/bin/test -d /var/lib/mysql/mysql",
:before => 'Service[mysqld]'
)
end