as noted, this logic is wrong.

also, line length here is too long.

should prolly just be

    str << " -p#{node['mysql']['server_root_password']}" unless node['mysql']['server_root_password'].empty?
    str << ' < /etc/mysql_grants.sql'