Class: Y2Network::Sysconfig::ConnectionConfigWriters::Base
- Inherits:
-
Object
- Object
- Y2Network::Sysconfig::ConnectionConfigWriters::Base
- Defined in:
- src/lib/y2network/sysconfig/connection_config_writers/base.rb
Overview
This is the base class for connection config writers.
The derived classes should implement #update_file method.
Direct Known Subclasses
Bonding, Bridge, Ctc, Dummy, Ethernet, Hsi, Infiniband, Lcs, Qeth, Tap, Tun, Usb, Vlan, Wireless
Instance Attribute Summary collapse
-
#file ⇒ Y2Network::Sysconfig::InterfaceFile
readonly
Interface's configuration file.
Instance Method Summary collapse
-
#initialize(file) ⇒ Base
constructor
Constructor.
-
#write(conn) ⇒ Object
Writes connection information to the interface configuration file.
Constructor Details
#initialize(file) ⇒ Base
Constructor
35 36 37 |
# File 'src/lib/y2network/sysconfig/connection_config_writers/base.rb', line 35 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Y2Network::Sysconfig::InterfaceFile (readonly)
Returns Interface's configuration file.
30 31 32 |
# File 'src/lib/y2network/sysconfig/connection_config_writers/base.rb', line 30 def file @file end |
Instance Method Details
#write(conn) ⇒ Object
Writes connection information to the interface configuration file
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'src/lib/y2network/sysconfig/connection_config_writers/base.rb', line 42 def write(conn) file.bootproto = conn.bootproto.name file.name = conn.description file.lladdr = conn.lladdress file.startmode = conn.startmode.to_s file.ifplugd_priority = conn.startmode.priority if conn.startmode.name == "ifplugd" if conn. && !conn..empty? file. = conn. end file.zone = conn.firewall_zone add_ips(conn) update_file(conn) add_hostname(conn) if conn.bootproto.static? end |