Skip to content

Commit

Permalink
Merge branch 'chrony' of github.com:yast/yast-ntp-client into chrony
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 28, 2017
2 parents 15e2e0d + c92f960 commit 7757bf7
Show file tree
Hide file tree
Showing 18 changed files with 229 additions and 3,823 deletions.
32 changes: 9 additions & 23 deletions src/clients/ntp-client_auto.rb
Expand Up @@ -24,6 +24,7 @@ class NtpClientAutoClient < Client
def main
Yast.import "UI"
Yast.import "Mode"
Yast.import "Report"
Yast.import "Stage"
Yast.import "Installation"

Expand Down Expand Up @@ -53,7 +54,7 @@ def main

# Create a summary
if @func == "Summary"
@ret = NtpClient.Summary
@ret = "<p>Not supported now</p>"
# Reset configuration
elsif @func == "Reset"
NtpClient.Import({})
Expand All @@ -63,32 +64,17 @@ def main
@ret = NtpClient.AutoPackages
# Change configuration (run AutoSequence)
elsif @func == "Change"
@ret = NtpClientAutoSequence()
# TODO: implement
Yast::Report.Error("Not supported yet for chrony")
@ret = :next
# Import configuration
elsif @func == "Import"
@ret = NtpClient.Import(@param)
Yast::Report.Error("Not supported yet for chrony")
@ret = true
# Return actual state
elsif @func == "Export"
# The ntp.conf has to be read after the
# package has been installed in the installation
# mode (bnc#928987)
# Mode.config : true during the installation when
# cloning the just installed system
if Mode.config && Stage.initial
ntp_conf = "/etc/ntp.conf"
installed_ntp_conf = File.join(Installation.destdir, ntp_conf)
# if ntp is not installed at all we cannot copy it, so return empty values
if !::File.exist?(installed_ntp_conf)
Builtins.y2milestone("Ntp is not installed, so return empty hash")
return {}
end
# copy ntp.conf from the installed system to
# running system
::FileUtils.cp installed_ntp_conf, ntp_conf
# read ntp.conf
NtpClient.ProcessNtpConf
end
@ret = NtpClient.Export
Yast::Report.Error("Not supported yet for chrony")
@ret = {}
# did configuration change
elsif @func == "GetModified"
@ret = NtpClient.modified
Expand Down
16 changes: 0 additions & 16 deletions src/clients/ntp-client_proposal.rb
Expand Up @@ -169,22 +169,6 @@ def ValidateSingleServer(ntp_server)
true
end

def AddSingleServer(server)
idx = NtpClient.findSyncRecord("server", server)

# -1 means adding new server
if idx == -1
Ops.set(NtpClient.selected_record, "address", server)
Ops.set(NtpClient.selected_record, "type", "server")
else
NtpClient.selectSyncRecord(idx)
end

NtpClient.storeSyncRecord

nil
end

def MakeProposal
ntp_items = []

Expand Down
290 changes: 0 additions & 290 deletions src/include/ntp-client/clocktypes.rb

This file was deleted.

0 comments on commit 7757bf7

Please sign in to comment.