Skip to content

Commit

Permalink
Fix yardoc
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Nov 7, 2024
1 parent aba3fbd commit 97328b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/lib/y2network/config_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,21 @@ def write(config, old_config = nil, only: nil)
#
# @param _config [Y2Network::Config] configuration to write
# @param _old_config [Y2Network::Config, nil] original configuration used for detecting changes
# @param _issues_list [Y2Issues::List] list of issues detected until the method is call
def write_routing(_config, _old_config, _issues_list); end

# Writes the connection configurations
#
# @param _config [Y2Network::Config] configuration to write
# @param _old_config [Y2Network::Config, nil] original configuration used for detecting changes
# @param _issues_list [Y2Issues::List] list of issues detected until the method is call
def write_connections(_config, _old_config, _issues_list); end

# Updates the DNS configuration
#
# @param config [Y2Network::Config] Current config object
# @param old_config [Y2Network::Config,nil] Config object with original configuration
# @param _issues_list [Y2Issues::List] list of issues detected until the method is call
def write_dns(config, old_config, _issues_list)
old_dns = old_config.dns if old_config
writer = Y2Network::ConfigWriters::DNSWriter.new
Expand All @@ -117,6 +120,7 @@ def write_dns(config, old_config, _issues_list)
#
# @param config [Y2Network::Config] Current config object
# @param old_config [Y2Network::Config,nil] Config object with original configuration
# @param _issues_list [Y2Issues::List] list of issues detected until the method is call
def write_hostname(config, old_config, _issues_list)
old_hostname = old_config.hostname if old_config
writer = Y2Network::ConfigWriters::HostnameWriter.new
Expand All @@ -128,6 +132,7 @@ def write_hostname(config, old_config, _issues_list)
#
# @param config [Y2Network::Config] Current config object
# @param _old_config [Y2Network::Config,nil] Config object with original configuration
# @param _issues_list [Y2Issues::List] list of issues detected until the method is call
def write_interfaces(config, _old_config, _issues_list)
writer = Y2Network::ConfigWriters::InterfacesWriter.new(reload: !Yast::Lan.write_only)
writer.write(config.interfaces)
Expand All @@ -137,6 +142,7 @@ def write_interfaces(config, _old_config, _issues_list)
#
# @param config [Y2Network::Config] Current config object
# @param _old_config [Y2Network::Config,nil] Config object with original configuration
# @param _issues_list [Y2Issues::List] list of issues detected until the method is call
def write_drivers(config, _old_config, _issues_list)
Y2Network::Driver.write_options(config.drivers)
end
Expand All @@ -146,6 +152,7 @@ def write_drivers(config, _old_config, _issues_list)
# TODO: extract this behaviour to a separate class.
#
# @param routing [Y2Network::Routing] routing configuration
# @param issues_list [Y2Issues::List] list of issues detected until the method is call
def write_ip_forwarding(routing, issues_list)
sysctl_config = CFA::SysctlConfig.new
sysctl_config.load
Expand Down
10 changes: 7 additions & 3 deletions src/lib/y2network/network_manager/config_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

require "y2network/config_writer"
require "y2network/network_manager/connection_config_writer"
require "y2issues"

module Y2Network
module NetworkManager
Expand All @@ -29,7 +30,8 @@ class ConfigWriter < Y2Network::ConfigWriter
# Updates the ip forwarding as the routes are written when writing the connections
#
# @param config [Y2Network::Config] Current config object
# @param old_config [Y2Network::Config,nil] Config object with original configuration
# @param _old_config [Y2Network::Config,nil] Config object with original configuration
# @param issues_list [Y2Issues::List] list of issues detected until the method is call
def write_routing(config, _old_config, issues_list)
write_ip_forwarding(config.routing, issues_list)

Expand All @@ -45,6 +47,7 @@ def write_routing(config, _old_config, issues_list)
#
# @param config [Y2Network::Config] Current config object
# @param _old_config [Y2Network::Config,nil] Config object with original configuration
# @param _issues_list [Y2Issues::List] list of issues detected until the method is call
def write_connections(config, _old_config, _issues_list)
writer = Y2Network::NetworkManager::ConnectionConfigWriter.new
config.connections.each do |conn|
Expand All @@ -64,8 +67,9 @@ def write_connections(config, _old_config, _issues_list)
# to the configuration file (see bsc#1181701).
#
# @param config [Y2Network::Config] Current config object
# @param old_config [Y2Network::Config,nil] Config object with original configuration
def write_dns(config, old_config, _issues_list)
# @param _old_config [Y2Network::Config,nil] Config object with original configuration
# @param _issues_list [Y2Issues::List] list of issues detected until the method is call
def write_dns(config, _old_config, _issues_list)
static = config.connections.by_bootproto(Y2Network::BootProtocol::STATIC)
return super if static.empty? || config.dns.nameservers.empty?

Expand Down

0 comments on commit 97328b1

Please sign in to comment.