Check that /var/lib/mysql actually contains files.

MySQL-server-advanced installs install the 'mysql' directory in /var/lib/mysql by default,
therefore the check fails and does not run mysql_install_db.
Check is adjusted to check if any files exist in the directory.
This commit is contained in:
Al Wiesner 2016-04-19 10:54:17 -04:00 committed by Jonathan Tripathy
parent 9801483727
commit 06fe1f9abb

View file

@ -57,7 +57,7 @@ Puppet::Type.type(:mysql_datadir).provide(:mysql, :parent => Puppet::Provider::M
def exists?
datadir = @resource[:datadir]
File.directory?("#{datadir}/mysql")
(File.directory?("#{datadir}/mysql")) && (Dir.entries("#{datadir}/mysql") - %w{ . .. }).any?
end
##