Class: Installation::RemoteFinishClient

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

Overview

Step of base installation finish for remote administration (VNC)

Instance Method Summary collapse

Constructor Details

#initializeRemoteFinishClient

Returns a new instance of RemoteFinishClient.



25
26
27
28
# File 'src/lib/installation/remote_finish_client.rb', line 25

def initialize
  Yast.import "Linuxrc"
  textdomain "installation"
end

Instance Method Details

#enable_remoteObject

Enables remote access



76
77
78
79
# File 'src/lib/installation/remote_finish_client.rb', line 76

def enable_remote
  remote.enable!
  remote.write
end

#modesArray<Symbol>

Modes in which #enable_remote should be called

Returns:

  • (Array<Symbol>)


71
72
73
# File 'src/lib/installation/remote_finish_client.rb', line 71

def modes
  Yast::Linuxrc.vnc ? [:installation, :autoinst] : []
end

#remoteObject



81
82
83
# File 'src/lib/installation/remote_finish_client.rb', line 81

def remote
  @remote ||= Y2Remote::Remote.instance
end

#run(*args) ⇒ Object

Executes the function passed as a first argument, to be called by WMF.CallFunction



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
# File 'src/lib/installation/remote_finish_client.rb', line 32

def run(*args)
  ret = nil
  func = if args.empty?
    ""
  else
    args.first.to_s
  end

  log.info "starting remote_finish"
  log.debug "func=#{func}"

  case func
  when "Info"
    ret = {
      "steps" => 1,
      "title" => title,
      "when"  => modes
    }
  when "Write"
    enable_remote
  else
    log.error "unknown function: #{func}"
  end

  log.debug "ret=#{ret}"
  log.info "remote_finish finished"
  ret
end

#titleObject

Text to display

Returns:

  • String



64
65
66
# File 'src/lib/installation/remote_finish_client.rb', line 64

def title
  _("Enabling remote administration...")
end