Skip to content

Commit

Permalink
Merge pull request puppetlabs#297 from reidmv/fix_postgresql_conf_quo…
Browse files Browse the repository at this point in the history
…te_logic

Fix postgresql_conf quote logic
  • Loading branch information
Ashley Penney committed Apr 3, 2014
2 parents e59a920 + 7b46af4 commit 1218791
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/provider/postgresql_conf/parsed.rb
Expand Up @@ -18,7 +18,7 @@
:to_line => proc { |h|

# simple string and numeric values don't need to be enclosed in quotes
dontneedquote = h[:value].match(/^(\w+|[0-9.-]+)$/)
dontneedquote = h[:value].match(/^(\w+)$/)
dontneedequal = h[:name].match(/^(include|include_if_exists)$/i)

str = h[:name].downcase # normalize case
Expand Down
18 changes: 18 additions & 0 deletions spec/acceptance/server/config_entry_spec.rb
Expand Up @@ -23,4 +23,22 @@ class { 'postgresql::server': }
expect(r.stderr).to eq('')
end
end

it 'should correctly set a quotes-required string' do
pp = <<-EOS.unindent
class { 'postgresql::server': }
postgresql::server::config_entry { 'listen_addresses':
value => '0.0.0.0',
}
EOS

apply_manifest(pp, :catch_failures => true)

psql('--command="show all" postgres') do |r|
r.stdout.should =~ /listen_adresses.+0\.0\.0\.0/
r.stderr.should be_empty
r.exit_code.should == 0
end
end
end

0 comments on commit 1218791

Please sign in to comment.