lib/specinfra/command/base.rb in specinfra-1.18.4 vs lib/specinfra/command/base.rb in specinfra-1.19.0

- old
+ new

@@ -346,8 +346,16 @@ end def get_ipaddress_of_host(name) "getent hosts #{escape(name)} | awk '{print $1}'" end + + def check_mysql(host, user, password, database) + cmd = "mysql -e 'SHOW DATABASES;' -h #{escape(host)}" + cmd = "#{cmd} -u #{escape(user)}" if user + cmd = "#{cmd} --password=#{escape(password)}" if password + cmd = "#{cmd} #{escape(database)}" if database + cmd + end end end end