Class: Installation::FinishClient
- Inherits:
-
Yast::Client
- Object
- Yast::Client
- Installation::FinishClient
- Includes:
- Yast::Logger
- Defined in:
- library/general/src/lib/installation/finish_client.rb
Overview
Abstract class that simplify writting finish clients for installation. It provides single entry point and abstract methods, that all finish clients need to implement.
Inst-Finish Scripts
About
They are called by the inst_finish.ycp installation client at the end of the first stage installation.
Part of these clients are called with SCR connected to inst-sys, the others are called after SCR gets switched to the installed system (chrooted).
Script inst_finish.ycp contains several stages, every has
label - visible in the writing progress
steps - list of additional inst_finish scripts that are called ("bingo" -> "bingo_finish.ycp") Important script is "switch_scr", after that call, SCR is connected to the just installed system.
Finish Scripts
Every single finish script is a non-interactive script (write-only). It's basically called twice:
At first "Info" returns in which modes "Write" should be called
Then "Write" should be called to do the job
Class Method Summary collapse
-
.run ⇒ Object
Entry point for calling client.
Instance Method Summary collapse
-
#info ⇒ Object
protected
Adapt the metadata for inst_finish API.
-
#modes ⇒ Array<Symbol>?
protected
Restrict in which modes it should run.
-
#run ⇒ Object
Dispatches to abstract method based on passed arguments to client.
-
#steps ⇒ Integer
protected
The number of client steps.
-
#title ⇒ String
protected
A title used to display to the user what is happening.
-
#write ⇒ Object
protected
Write configuration.
Class Method Details
.run ⇒ Object
Entry point for calling client. The only part needed in client rb file.
44 45 46 |
# File 'library/general/src/lib/installation/finish_client.rb', line 44 def self.run new.run end |
Instance Method Details
#info ⇒ Object (protected)
Adapt the metadata for inst_finish API
91 92 93 94 95 96 97 |
# File 'library/general/src/lib/installation/finish_client.rb', line 91 def info { "when" => modes, "steps" => steps, "title" => title } end |
#modes ⇒ Array<Symbol>? (protected)
Restrict in which modes it should run.
76 77 78 |
# File 'library/general/src/lib/installation/finish_client.rb', line 76 def modes nil end |
#run ⇒ Object
Dispatches to abstract method based on passed arguments to client
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'library/general/src/lib/installation/finish_client.rb', line 49 def run func = Yast::WFM.Args.first log.info "Called #{self.class}.run with #{func}" case func when "Info" info when "Write" write else raise ArgumentError, "Invalid action for proposal '#{func.inspect}'" end end |
#steps ⇒ Integer (protected)
Returns the number of client steps.
81 82 83 |
# File 'library/general/src/lib/installation/finish_client.rb', line 81 def steps 1 end |
#title ⇒ String (protected)
Returns a title used to display to the user what is happening.
86 87 88 |
# File 'library/general/src/lib/installation/finish_client.rb', line 86 def title raise NotImplementedError, "Calling abstract method 'title'" end |
#write ⇒ Object (protected)
Write configuration.
66 67 68 |
# File 'library/general/src/lib/installation/finish_client.rb', line 66 def write raise NotImplementedError, "Calling abstract method 'write'" end |