Class: Y2Network::Clients::Auto
- Inherits:
-
Installation::AutoClient
- Object
- Installation::AutoClient
- Y2Network::Clients::Auto
- Defined in:
- src/lib/y2network/clients/auto.rb
Overview
This class is responsible of AutoYaST network configuration
Class Attribute Summary collapse
-
.modified ⇒ Object
Returns the value of attribute modified.
Instance Method Summary collapse
- #change ⇒ Object
- #export ⇒ Object
- #import(profile) ⇒ Object
-
#initialize ⇒ Auto
constructor
Constructor.
- #modified ⇒ Object
- #modified? ⇒ Boolean
- #packages ⇒ Object
- #read ⇒ Object
- #reset ⇒ Object
- #summary ⇒ Object
- #write ⇒ Object
Constructor Details
Class Attribute Details
.modified ⇒ Object
Returns the value of attribute modified.
108 109 110 |
# File 'src/lib/y2network/clients/auto.rb', line 108 def modified @modified end |
Instance Method Details
#change ⇒ Object
70 71 72 73 74 75 |
# File 'src/lib/y2network/clients/auto.rb', line 70 def change if !Yast::Lan.yast_config Yast::Lan.add_config(:yast, Y2Network::Config.new(:source, :config)) end LanAutoSequence("") end |
#export ⇒ Object
111 112 113 114 115 |
# File 'src/lib/y2network/clients/auto.rb', line 111 def export raw_config = Yast::Lan.Export log.debug("settings: #{raw_config.inspect}") adapt_for_autoyast(raw_config) end |
#import(profile) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'src/lib/y2network/clients/auto.rb', line 77 def import(profile) Yast::NetworkAutoYast.instance.ay_networking_section = profile modified_profile = Yast::Lan.FromAY(profile) # see bnc#498993 # in case keep_install_network is set to true (in AY) # we'll keep values from installation # and merge with XML data (bnc#712864) if modified_profile.fetch("keep_install_network", true) modified_profile = Yast::NetworkAutoYast.instance.merge_configs(modified_profile) end Yast::Lan.Import(modified_profile) true end |
#modified ⇒ Object
99 100 101 |
# File 'src/lib/y2network/clients/auto.rb', line 99 def modified self.class.modified = true end |
#modified? ⇒ Boolean
103 104 105 |
# File 'src/lib/y2network/clients/auto.rb', line 103 def modified? !!self.class.modified end |
#packages ⇒ Object
95 96 97 |
# File 'src/lib/y2network/clients/auto.rb', line 95 def packages Yast::Lan.AutoPackages end |
#read ⇒ Object
36 37 38 39 40 41 |
# File 'src/lib/y2network/clients/auto.rb', line 36 def read @progress_orig = Yast::Progress.set(false) ret = Yast::Lan.Read(:nocache) Yast::Progress.set(@progress_orig) ret end |
#reset ⇒ Object
64 65 66 67 68 |
# File 'src/lib/y2network/clients/auto.rb', line 64 def reset Yast::Lan.Import({}) Yast::Lan.clear_configs {} end |
#summary ⇒ Object
60 61 62 |
# File 'src/lib/y2network/clients/auto.rb', line 60 def summary Yast::Lan.Summary("summary") end |
#write ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'src/lib/y2network/clients/auto.rb', line 43 def write @progress_orig = Yast::Progress.set(false) result = Yast::Lan.WriteOnly log.error("Writing lan config failed") if !result @ret &&= result timeout = Yast::Lan.autoinst.ip_check_timeout || -1 if (timeout >= 0) && Lan.isAnyInterfaceDown Builtins.y2debug("timeout %1", timeout) error_text = _("Configuration Error: uninitialized interface.") (timeout == 0) ? Popup.Error(error_text) : Popup.TimedError(error_text, timeout) end Yast::Progress.set(@progress_orig) end |