Skip to content

Commit

Permalink
Keep header when setting added to empty section
Browse files Browse the repository at this point in the history
(MODULES-1821) When adding a setting to an empty, pre-existing
section (one with just a [section] header), the header wasn't
written out.  This commit is meant to fix that problem.
  • Loading branch information
cjepeway committed May 4, 2018
1 parent f975509 commit 8e72205
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/util/ini_file.rb
Expand Up @@ -148,8 +148,8 @@ def save
fh.puts("#{@section_prefix}#{section.name}#{@section_suffix}")
end

if !section.new_section? && !section.empty?
# write all of the pre-existing settings
if !section.new_section?
# write all of the pre-existing lines
(section.start_line..section.end_line).each do |line_num|
line = lines[line_num]

Expand Down

0 comments on commit 8e72205

Please sign in to comment.