Class: Installation::SystemRoleHandlersRunner

Inherits:
Object
  • Object
show all
Includes:
Yast::Logger
Defined in:
src/lib/installation/system_role_handlers_runner.rb

Overview

Run system roles handlers

System role handlers are a mechanism to execute code depending on the selected role. Currently those handlers are only used in the inst_finish client, but they could be extended in the future.

Instance Method Summary collapse

Instance Method Details

#finish(role_id) ⇒ Object

Run the finish handler for a given role



32
33
34
35
36
37
38
39
40
41
42
43
# File 'src/lib/installation/system_role_handlers_runner.rb', line 32

def finish(role_id)
  return unless require_handler(role_id)

  class_name_role = role_id.split("_").map(&:capitalize).join
  handler = "Y2SystemRoleHandlers::#{class_name_role}Finish"

  if Object.const_defined?(handler)
    Object.const_get(handler).new.run
  else
    log.info("There is no special finisher for #{role_id} ('#{class_name_role}' not defined)")
  end
end