Skip to content

Commit

Permalink
Explain why no take care of stdout.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed May 23, 2016
1 parent 5caa777 commit 4e6bbc8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/NtpClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,13 @@ def sntp_test(server, ip_version = 4)
)

Builtins.y2milestone("sntp test response: #{output}")

# sntp returns always 0 if not called with option -S or -s (set system time)
# so this is a workaround at least to return false in case server is not
# reachable.
# reachable. We could also take care of stdout checking if it includes
# "no (U|B)CST reponse", but it also implies be to dependent in the
# future and the ntp package should take care of it and aswer other exit
# code instead of 0
output["stderr"].include?("lookup error") ? false : output["exit"] == 0
end

Expand Down

0 comments on commit 4e6bbc8

Please sign in to comment.