Class: Yast::InstallationSettingsFinishClient

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

Instance Method Summary collapse

Instance Method Details

#mainObject



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
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'src/lib/installation/clients/installation_settings_finish.rb', line 30

def main
  textdomain "installation"

  Yast.import "ProductControl"
  Yast.import "InstData"
  Yast.import "Mode"

  @ret = nil
  @func = ""
  @param = {}

  # Check arguments
  if Ops.greater_than(Builtins.size(WFM.Args), 0) &&
      Ops.is_string?(WFM.Args(0))
    @func = Convert.to_string(WFM.Args(0))
    if Ops.greater_than(Builtins.size(WFM.Args), 1) &&
        Ops.is_map?(WFM.Args(1))
      @param = Convert.to_map(WFM.Args(1))
    end
  end
  Builtins.y2milestone("starting installation_settings_finish")
  Builtins.y2debug("func=%1", @func)
  Builtins.y2debug("param=%1", @param)

  case @func
  when "Info"
    @ret = {
      "steps" => 1,
      # progress step title
      "title" => _(
        "Writing automatic configuration..."
      ),
      # Live Installation has a second stage workflow now (BNC #675516)
      "when"  => [
        :installation,
        :live_installation,
        :update,
        :autoinst
      ]
    }
  when "Write"
    Write()
  else
    Builtins.y2error("unknown function: %1", @func)
    @ret = nil
  end

  deep_copy(@ret)
end

#WriteObject



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'src/lib/installation/clients/installation_settings_finish.rb', line 80

def Write
  if ProductControl.GetDisabledModules.nil?
    Builtins.y2error("Wrong definition of DisabledModules")
    return
  end

  if InstData.wizardsteps_disabled_modules.nil?
    Builtins.y2error("Path to write disabled modules is not defined!")
    return
  end

  Builtins.y2milestone(
    "Writing disabled modules %1 into %2",
    ProductControl.GetDisabledModules,
    InstData.wizardsteps_disabled_modules
  )

  if SCR.Write(
    path(".target.ycp"),
    InstData.wizardsteps_disabled_modules,
    ProductControl.GetDisabledModules
  ) != true
    Builtins.y2error("Cannot write disabled modules")
  end

  Builtins.y2milestone(
    "Writing disabled proposals %1 into %2",
    ProductControl.GetDisabledProposals,
    InstData.wizardsteps_disabled_proposals
  )

  if SCR.Write(
    path(".target.ycp"),
    InstData.wizardsteps_disabled_proposals,
    ProductControl.GetDisabledProposals
  ) != true
    Builtins.y2error("Cannot write disabled proposals")
  end

  Builtins.y2milestone(
    "Writing disabled subproposals %1 into %2",
    ProductControl.GetDisabledSubProposals,
    InstData.wizardsteps_disabled_subproposals
  )

  if SCR.Write(
    path(".target.ycp"),
    InstData.wizardsteps_disabled_subproposals,
    ProductControl.GetDisabledSubProposals
  ) != true
    Builtins.y2error("Cannot write disabled subproposals")
  end

  Builtins.y2milestone("Anyway, successful")

  nil
end