Class: Installation::FinishClient

Inherits:
Yast::Client
  • Object
show all
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

Examples:

how to run client

require "installation/example_finish"
::Installation::ExampleFinish.run

See Also:

  • example client in installation clone_finish.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.runObject

Entry point for calling client. The only part needed in client rb file.

Returns:

  • response from abstract methods



44
45
46
# File 'library/general/src/lib/installation/finish_client.rb', line 44

def self.run
  new.run
end

Instance Method Details

#runObject

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