Class: Yast::InstDiskForImageClient

Inherits:
Client
  • Object
show all
Defined in:
src/lib/installation/clients/inst_disk_for_image.rb

Overview

Asks for disk to deploy an image to. Useful for OEM image installation (replacing contents of the full disk), not for regular installation process

Instance Method Summary collapse

Instance Method Details

#mainObject



28
29
30
31
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
60
61
62
63
64
65
# File 'src/lib/installation/clients/inst_disk_for_image.rb', line 28

def main
  Yast.import "UI"

  textdomain "installation"

  Yast.import "Popup"
  Yast.import "GetInstArgs"
  Yast.import "Wizard"
  Yast.import "Storage"
  Yast.import "InstData"

  @test_mode = WFM.Args.include?("test")

  show_disk_for_image_dialog

  ret = nil
  disk = nil

  continue_buttons = [:next, :back, :close, :abort]
  until continue_buttons.include?(ret)
    ret = UI.UserInput

    case ret
    when :next
      disk = UI.QueryWidget(Id(:disk), :Value)
      ret = WFM.CallFunction("inst_doit", [])
      if ret == :next
        InstData.image_target_disk = disk
      else
        ret = nil
      end
    when :abort
      ret = nil unless Popup.ConfirmAbort(:painless)
    end
  end

  ret
end