Skip to content

Commit

Permalink
Re-Add the ability to set a empty string as option parameter
Browse files Browse the repository at this point in the history
Prior to 136b1aa it was possible to
have an empty string as value of a my.cnf arameter, resulting in a line
with just the parameter name.

That commit re-enable that behaviour that was removed by accident.
  • Loading branch information
roidelapluie committed Jan 8, 2016
1 parent 1cfddec commit 785038c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions spec/classes/mycnf_template_spec.rb
Expand Up @@ -29,6 +29,11 @@
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
let(:params) {{ :override_options => { 'mysqld' => { 'ssl' => true }}}}
it { is_expected.to contain_file('mysql-config-file').with_content(/ssl/) }
Expand Down
2 changes: 1 addition & 1 deletion templates/my.cnf.erb
Expand Up @@ -6,7 +6,7 @@
<% v.sort.map do |ki, vi| -%>
<% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%>
<% next %>
<% elsif vi == true or v == '' -%>
<% elsif vi == true or vi == '' -%>
<%= ki %>
<% elsif vi.is_a?(Array) -%>
<% vi.each do |vii| -%>
Expand Down

0 comments on commit 785038c

Please sign in to comment.