Skip to content

Commit

Permalink
Merge pull request #60 from teclator/nil_comments
Browse files Browse the repository at this point in the history
Convert ntp record's comment to string to avoid nil values (bsc#977610)
  • Loading branch information
teclator committed Jun 14, 2016
2 parents 5708d19 + fae50a8 commit c30a98c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions package/yast2-ntp-client.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jun 14 06:54:54 UTC 2016 - kanderssen@suse.com

- Fix handling of NTP records without comments (bsc#977610)
- 3.1.26

-------------------------------------------------------------------
Thu Jun 2 07:40:56 UTC 2016 - kanderssen@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.1.25
Version: 3.1.26
Release: 0
Summary: YaST2 - NTP Client Configuration
License: GPL-2.0+
Expand Down
8 changes: 4 additions & 4 deletions src/modules/NtpClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1158,23 +1158,23 @@ def update_cron_settings

def record_to_h(record)
{
"comment" => record["comment"],
"comment" => record["comment"].to_s,
"kind" => "value",
"name" => record["type"] == "__clock" ? "server" : record["type"],
"type" => 0,
"value" => "#{record["address"]} #{record["options"]}"
"value" => "#{record["address"]} #{record["options"]}".strip
}
end

# Parse fudge options of given record and returns a new fudge record for
# write
def fugde_options_to_h(record)
{
"comment" => record["fudge_comment"],
"comment" => record["fudge_comment"].to_s,
"kind" => "value",
"name" => "fudge",
"type" => 0,
"value" => "#{record["address"]} #{record["fudge_options"]}"
"value" => "#{record["address"]} #{record["fudge_options"]}".strip
}
end

Expand Down

0 comments on commit c30a98c

Please sign in to comment.