From 7c16c52ef48a63aaaff4ee9128b323abb64bb662 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Fri, 9 May 2014 13:58:46 -0400 Subject: [PATCH] Try to add some checks so the test doesn't do an rm -rf / --- spec/acceptance/mysql_server_root_password_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/mysql_server_root_password_spec.rb b/spec/acceptance/mysql_server_root_password_spec.rb index f6035f0..c97b4eb 100644 --- a/spec/acceptance/mysql_server_root_password_spec.rb +++ b/spec/acceptance/mysql_server_root_password_spec.rb @@ -18,7 +18,7 @@ describe 'mysql::server::root_password class', :unless => UNSUPPORTED_PLATFORMS. it 'deletes all databases' do case fact('osfamily') when 'RedHat', 'Suse' - shell('rm -rf `grep datadir /etc/my.cnf | cut -d" " -f 3`/*') + shell('grep -q datadir /etc/my.cnf && rm -rf `grep datadir /etc/my.cnf | cut -d" " -f 3`/*') when 'Debian' shell('rm -rf `grep datadir /etc/mysql/my.cnf | cut -d" " -f 3`/*') shell('mysql_install_db')