Skip to content

Commit

Permalink
Do not modify values when saving
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Aug 19, 2019
1 parent c3ae2e5 commit 3297392
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion src/lib/cfa/ntp_conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def save
matcher = Matcher.new(key: r.augeas[:key], value_matcher: r.augeas[:value])
placer = BeforePlacer.new(matcher)
comments.each do |comment|
data.add("#comment[]", comment.strip, placer)
data.add("#comment[]", comment, placer)
end
end
super
Expand Down
13 changes: 0 additions & 13 deletions test/cfa/ntp_conf_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,6 @@ def ntp_conf(file)
expect(file.content.lines).to include("#test comment 2\n")
expect(file.content.lines).to include("#test comment3\n")
end

# see bsc #1142026
it "can write multi lines comments with unstripped whitespaces from autoyast profiles" do
record = CFA::NtpConf::ServerRecord.new
record.value = "4.pool.ntp.org"
record.comment = " test comment 4 \n \n test comment 5 "
ntp.records << record
expect(record.comment).to eq " test comment 4 \n \n test comment 5 "
ntp.save
expect(file.content.lines).to include("#test comment 4\n")
expect(file.content.lines).to include("#test comment 5\n")
expect(file.content.lines).to include("server 4.pool.ntp.org\n")
end
end

context "when a record is deleted" do
Expand Down

0 comments on commit 3297392

Please sign in to comment.