-
Notifications
You must be signed in to change notification settings - Fork 15
/
auto.rb
73 lines (58 loc) · 1.53 KB
/
auto.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
require "yast"
require "installation/auto_client"
Yast.import "NtpClient"
Yast.import "Progress"
require "y2ntp_client/dialog/main"
module Y2NtpClient
module Client
# This is a client for autoinstallation. It takes its arguments,
# goes through the configuration and return the setting.
# Does not do any changes to the configuration.
class Auto < ::Installation::AutoClient
def initialize
super
textdomain "ntp-client"
end
def summary
Yast::NtpClient.Summary
end
def import(profile)
Yast::NtpClient.Import(profile)
end
def export
Yast::NtpClient.Export
end
def reset
Yast::NtpClient.Import({})
end
def change
Y2NtpClient::Dialog::Main.run
end
def write
progress_orig = Yast::Progress.set(false)
# ensure to merge config to system chrony configuration to do minimal configuration
Yast::NtpClient.merge_to_system
Yast::NtpClient.write_only = true
ret = Yast::NtpClient.Write
Yast::Progress.set(progress_orig)
ret
end
def read
progress_orig = Yast::Progress.set(false)
Yast::NtpClient.write_only = true
ret = Yast::NtpClient.Read
Yast::Progress.set(progress_orig)
ret
end
def packages
Yast::NtpClient.AutoPackages
end
def modified
Yast::NtpClient.modified = true
end
def modified?
Yast::NtpClient.modified
end
end
end
end