Skip to content

Commit

Permalink
Revert "Fixed saving /etc/ntp.conf with certain comments (bsc#1142026)"
Browse files Browse the repository at this point in the history
This reverts commit 17af584.
  • Loading branch information
joseivanlopez committed Aug 19, 2019
1 parent 4b2723a commit 582acc1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 24 deletions.
6 changes: 0 additions & 6 deletions package/yast2-ntp-client.changes
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
-------------------------------------------------------------------
Fri Aug 02 15:16:17 CEST 2019 - aschnell@suse.com

- Fixed saving /etc/ntp.conf with certain comments (bsc#1142026)
- 3.2.19

-------------------------------------------------------------------
Thu Dec 13 12:45:27 UTC 2018 - knut.anderssen@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-ntp-client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-ntp-client
Version: 3.2.19
Version: 3.2.18
Release: 0
Summary: YaST2 - NTP Client Configuration
License: GPL-2.0+
Expand Down
4 changes: 2 additions & 2 deletions src/lib/cfa/ntp_conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def save
comments = r.augeas[:multiline].split("\n")
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)
comments.each do |c|
data.add("#comment[]", c, placer)
end
end
super
Expand Down
3 changes: 1 addition & 2 deletions src/modules/NtpClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,7 @@ def AutoPackages
# Remove blank spaces in values
#
# @note to avoid augeas parsing errors, comments should be sanitized by
# removing blank spaces at the beginning and adding line break. Further
# sanitation is done in NtpConf.save.
# removing blank spaces at the beginning and adding line break.
def sanitize_record(record)
sanitized = record.dup
sanitized.each do |key, value|
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 582acc1

Please sign in to comment.