Skip to content

Commit c0a9ada

Browse files
author
Julien Pivotto
committed
Re-Add the ability to set a empty string as option parameter
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 behavior that was removed by accident.
1 parent 1cfddec commit c0a9ada

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

spec/classes/mycnf_template_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
end
3030
end
3131

32+
describe 'skip-name-resolve set to an empty string' do
33+
let(:params) {{ :override_options => { 'mysqld' => { 'skip-name-resolve' => '' }}}}
34+
it { is_expected.to contain_file('mysql-config-file').with_content(/^skip-name-resolve$/) }
35+
end
36+
3237
describe 'ssl set to true' do
3338
let(:params) {{ :override_options => { 'mysqld' => { 'ssl' => true }}}}
3439
it { is_expected.to contain_file('mysql-config-file').with_content(/ssl/) }

templates/my.cnf.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<% v.sort.map do |ki, vi| -%>
77
<% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%>
88
<% next %>
9-
<% elsif vi == true or v == '' -%>
9+
<% elsif vi == true or vi == '' -%>
1010
<%= ki %>
1111
<% elsif vi.is_a?(Array) -%>
1212
<% vi.each do |vii| -%>

0 commit comments

Comments
 (0)