Class: Yast::NetworkFinishClient

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

Instance Method Summary collapse

Instance Method Details

#mainObject


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
# File 'src/lib/installation/clients/network_finish.rb', line 33

def main
  textdomain "installation"

  Yast.import "ModulesConf"

  @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 network_finish")

  case @func
  when "Info"
    return {
      "steps" => 1,
      # progress step title
      "title" => _("Saving network configuration..."),
      "when"  => [:installation, :autoinst]
    }
  when "Write"
    Builtins.y2milestone("Save network configuration")
    WFM.CallFunction("save_network")
    # false == don't force
    ModulesConf.RunDepmod(false)
  else
    Builtins.y2error("unknown function: %1", @func)
    @ret = nil
  end

  Builtins.y2milestone("network_finish finished")
  deep_copy(@ret)
end