Re-Add the ability to set a empty string as option parameter

Prior to 136b1aa646 it was possible to
have an empty string as value of a my.cnf parameter, resulting in a line
with just the parameter name.

That commit re-enable that behavior that was removed by accident.
This commit is contained in:
Julien Pivotto 2016-01-08 13:52:23 +01:00
parent 1cfddec3ff
commit e30e0bc958
2 changed files with 6 additions and 1 deletions

View file

@ -29,6 +29,11 @@ describe 'mysql::server' do
end end
end end
describe 'skip-name-resolve set to an empty string' do
let(:params) {{ :override_options => { 'mysqld' => { 'skip-name-resolve' => '' }}}}
it { is_expected.to contain_file('mysql-config-file').with_content(/^skip-name-resolve$/) }
end
describe 'ssl set to true' do describe 'ssl set to true' do
let(:params) {{ :override_options => { 'mysqld' => { 'ssl' => true }}}} let(:params) {{ :override_options => { 'mysqld' => { 'ssl' => true }}}}
it { is_expected.to contain_file('mysql-config-file').with_content(/ssl/) } it { is_expected.to contain_file('mysql-config-file').with_content(/ssl/) }

View file

@ -6,7 +6,7 @@
<% v.sort.map do |ki, vi| -%> <% v.sort.map do |ki, vi| -%>
<% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%> <% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%>
<% next %> <% next %>
<% elsif vi == true or v == '' -%> <% elsif vi == true or vi == '' -%>
<%= ki %> <%= ki %>
<% elsif vi.is_a?(Array) -%> <% elsif vi.is_a?(Array) -%>
<% vi.each do |vii| -%> <% vi.each do |vii| -%>