Class: Y2Network::Sequences::Interface

Inherits:
Object
  • Object
show all
Includes:
Yast::I18n, Yast::Logger
Defined in:
src/lib/y2network/sequences/interface.rb

Overview

The responsibility of this class is to drive workflow for sequence of dialogs.

In this case, allowed operations for interface are, 'add' for adding a new interface, 'edit' for editing an existing device / interface or 'init_s390' for s390 initialization which needs specific activation before using it.

TODO: use UI::Sequence, but it needs also another object dialogs e.g for wifi

Instance Method Summary collapse

Constructor Details

#initializeInterface

Returns a new instance of Interface


35
36
37
# File 'src/lib/y2network/sequences/interface.rb', line 35

def initialize
  Yast.include self, "network/lan/wizards.rb"
end

Instance Method Details

#add(default: nil) ⇒ Object

Starts sequence for adding new interface and configuring it


40
41
42
43
44
45
46
47
48
49
# File 'src/lib/y2network/sequences/interface.rb', line 40

def add(default: nil)
  res = Y2Network::Dialogs::AddInterface.run(default: default)
  return unless res

  sym = edit(res)
  log.info "result of following edit #{sym.inspect}"
  sym = add(default: res.type) if sym == :back

  sym
end

#edit(builder) ⇒ Object

Starts sequence for editing configuration of interface


52
53
54
# File 'src/lib/y2network/sequences/interface.rb', line 52

def edit(builder)
  NetworkCardSequence("edit", builder: builder)
end

#init_s390(builder) ⇒ Object

Starts sequence for activating s390 device and configuring it


57
58
59
# File 'src/lib/y2network/sequences/interface.rb', line 57

def init_s390(builder)
  NetworkCardSequence("init_s390", builder: builder)
end