Skip to content

Commit 5dd5428

Browse files
author
Morgan Haskel
committed
Fix errors with future parser
1 parent b6c81ef commit 5dd5428

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/puppet/provider/postgresql_conf/parsed.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@
1818
:to_line => proc { |h|
1919

2020
# simple string and numeric values don't need to be enclosed in quotes
21-
dontneedquote = h[:value].match(/^(\w+)$/)
21+
if h[:value].is_a?(Fixnum)
22+
val = h[:value].to_s
23+
else
24+
val = h[:value]
25+
end
26+
dontneedquote = val.match(/^(\w+)$/)
2227
dontneedequal = h[:name].match(/^(include|include_if_exists)$/i)
2328

2429
str = h[:name].downcase # normalize case
2530
str += dontneedequal ? ' ' : ' = '
2631
str += "'" unless dontneedquote && !dontneedequal
27-
str += h[:value]
32+
str += val
2833
str += "'" unless dontneedquote && !dontneedequal
2934
str += " # #{h[:comment]}" unless (h[:comment].nil? or h[:comment] == :absent)
3035
str

0 commit comments

Comments
 (0)