Class: Yast::SshImportProposalClient

Inherits:
Installation::ProposalClient
  • Object
show all
Includes:
I18n, Logger
Defined in:
src/lib/installation/clients/ssh_import_proposal.rb

Overview

Proposal client for SSH keys import

Instance Method Summary collapse

Constructor Details

#initializeSshImportProposalClient

Returns a new instance of SshImportProposalClient.



11
12
13
14
15
# File 'src/lib/installation/clients/ssh_import_proposal.rb', line 11

def initialize
  super
  Yast.import "UI"
  textdomain "installation"
end

Instance Method Details

#ask_user(param) ⇒ Object (protected)



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'src/lib/installation/clients/ssh_import_proposal.rb', line 47

def ask_user(param)
  args = {
    "enable_back" => true,
    "enable_next" => param.fetch("has_next", false),
    "going_back"  => true
  }

  log.info "Asking user which SSH keys to import"
  begin
    Yast::Wizard.OpenAcceptDialog
    result = WFM.CallFunction("inst_ssh_import", [args])
  ensure
    Yast::Wizard.CloseDialog
  end
  log.info "Returning from ssh_import ask_user with #{result}"

  { "workflow_sequence" => result }
end

#descriptionObject (protected)



19
20
21
22
23
24
25
26
27
# File 'src/lib/installation/clients/ssh_import_proposal.rb', line 19

def description
  {
    # proposal part - bootloader label
    "rich_text_title" => _("Import SSH Host Keys and Configuration"),
    # menubutton entry
    "menu_title"      => _("&Import SSH Host Keys and Configuration"),
    "id"              => "ssh_import"
  }
end

#importerObject (protected)



37
38
39
# File 'src/lib/installation/clients/ssh_import_proposal.rb', line 37

def importer
  ::Installation::SshImporter.instance
end

#make_proposal(attrs) ⇒ Object (protected)



29
30
31
32
33
34
35
# File 'src/lib/installation/clients/ssh_import_proposal.rb', line 29

def make_proposal(attrs)
  importer.reset if attrs["force_reset"]
  {
    "preformatted_proposal" => preformatted_proposal,
    "links"                 => ["ssh_import"]
  }
end

#preformatted_proposalObject (protected)



41
42
43
44
45
# File 'src/lib/installation/clients/ssh_import_proposal.rb', line 41

def preformatted_proposal
  ::Installation::SshImporterPresenter.new(
    ::Installation::SshImporter.instance
  ).summary
end