Skip to content

Commit

Permalink
Rely on the new Y2Network::NtpServer class
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Feb 19, 2020
1 parent 243f73a commit e6b3db0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions timezone/src/include/timezone/dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
# Dialogs for timeone and time configuration.
#
# $Id$

require "y2network/ntp_server"

module Yast
module TimezoneDialogsInclude
def initialize_timezone_dialogs(include_target)
Expand All @@ -47,7 +50,6 @@ def initialize_timezone_dialogs(include_target)
Yast.import "NetworkService"
Yast.import "Package"
Yast.import "Popup"
Yast.import "Product"
Yast.import "ProductFeatures"
Yast.import "Service"
Yast.import "Stage"
Expand Down Expand Up @@ -575,12 +577,7 @@ def TimezoneDialog(args)
@ntp_used = true
# configure NTP client
# to prevent misusage of ntp.org we need to distinguish opensuse and SLE usage
base_products = Product.FindBaseProducts
if base_products.any? { |p| p["name"] =~ /openSUSE/i }
servers = (0..3).map { |i| "#{i}.opensuse.pool.ntp.org" }
else
servers = (0..3).map { |i| "#{i}.novell.pool.ntp.org" }
end
servers = Y2Network::NtpServer.default_servers.map(&:hostname)
@ntp_server = servers.sample
# Dot not select a dhcp ntp server by default but add it to the offered
# list (fate#323454)
Expand Down

0 comments on commit e6b3db0

Please sign in to comment.