Quote the password

It is possible to have a # in a password, which is parsed as a comment.
By quoting the password this is no problem.
This commit is contained in:
Ewoud Kohl van Wijngaarden 2013-04-03 19:07:32 +02:00 committed by Ewoud Kohl van Wijngaarden
parent 08579ef07e
commit 59a6fb8097
2 changed files with 3 additions and 3 deletions

View file

@ -70,7 +70,7 @@ describe 'mysql::config' do
)}
it { should contain_file('/root/.my.cnf').with(
'content' => "[client]\nuser=root\nhost=localhost\npassword=foo\n",
'content' => "[client]\nuser=root\nhost=localhost\npassword='foo'\n",
'require' => 'Exec[set_mysql_rootpw]'
)}
@ -203,7 +203,7 @@ describe 'mysql::config' do
)}
it { should contain_file('/root/.my.cnf').with(
'content' => "[client]\nuser=root\nhost=localhost\npassword=foo\n",
'content' => "[client]\nuser=root\nhost=localhost\npassword='foo'\n",
'require' => 'Exec[set_mysql_rootpw]'
)}

View file

@ -2,5 +2,5 @@
user=root
host=localhost
<% unless @root_password == 'UNSET' -%>
password=<%= @root_password %>
password='<%= @root_password %>'
<% end -%>