Module: Yast

Included in:
InstallInfConvertor, NetworkRoutinesInclude
Defined in:
src/clients/lan.rb,
src/modules/DNS.rb,
src/modules/Lan.rb,
src/clients/host.rb,
src/modules/Host.rb,
src/clients/remote.rb,
src/clients/network.rb,
src/modules/Routing.rb,
src/clients/host_auto.rb,
src/clients/lan_export.rb,
src/lib/network/wicked.rb,
src/modules/NetHwDetection.rb,
src/include/network/complex.rb,
src/include/network/runtime.rb,
src/include/network/widgets.rb,
src/include/network/lan/dhcp.rb,
src/include/network/lan/help.rb,
src/include/network/lan/s390.rb,
src/include/network/routines.rb,
src/include/network/lan/address.rb,
src/include/network/lan/cmdline.rb,
src/include/network/lan/complex.rb,
src/include/network/lan/wizards.rb,
src/include/network/lan/hardware.rb,
src/include/network/services/dns.rb,
src/lib/network/clients/inst_lan.rb,
src/lib/network/network_autoyast.rb,
src/include/network/services/host.rb,
src/include/network/services/routing.rb,
src/lib/network/clients/save_network.rb,
src/lib/network/confirm_virt_proposal.rb,
src/lib/network/install_inf_convertor.rb,
src/lib/network/clients/inst_setup_dhcp.rb,
src/lib/network/clients/network_proposal.rb,
src/lib/network/network_autoconfiguration.rb

Overview


Copyright (c) 2012 Novell, Inc. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, contact Novell, Inc.

To contact Novell about this file by physical or electronic mail, you may find current contact information at www.novell.com


File: include/network/services/host.ycp Module: Network configuration Summary: Hosts configuration dialogs Authors: Michal Svec [email protected]

Hosts configuration dialogs

Defined Under Namespace

Modules: NetworkComplexInclude, NetworkLanAddressInclude, NetworkLanCmdlineInclude, NetworkLanComplexInclude, NetworkLanDhcpInclude, NetworkLanHardwareInclude, NetworkLanHelpInclude, NetworkLanS390Include, NetworkLanWizardsInclude, NetworkRoutinesInclude, NetworkRuntimeInclude, NetworkServicesDnsInclude, NetworkServicesHostInclude, NetworkServicesRoutingInclude, NetworkWidgetsInclude, Wicked Classes: ConfirmVirtProposal, DNSClass, HostAutoClient, HostClass, HostClient, InstLanClient, InstallInfConvertor, LanClass, LanClient, LanExportClient, NetHwDetectionClass, NetworkAutoYast, NetworkAutoconfiguration, NetworkClient, NetworkProposal, RemoteClient, RoutingClass, SaveNetworkClient, SetupDhcp

Constant Summary collapse

DNS =
DNSClass.new
Lan =
LanClass.new
Host =
HostClass.new
Routing =
RoutingClass.new
NetHwDetection =
NetHwDetectionClass.new

Instance Method Summary collapse

Instance Method Details

#load_hosts(load_only: false) ⇒ Object

Initializes internal state according the /etc/hosts

Parameters:

  • load_only (Boolean) (defaults to: false)

    true if you want load data and do not need to detect changes later (@see Host::GetModified)



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'src/modules/Host.rb', line 342

def load_hosts(load_only: false)
  return false if SCR.Read(path(".target.size"), CFA::Hosts::PATH) <= 0

  @hosts = CFA::Hosts.new
  @hosts.load

  # save hosts to check for changes later
  @initial_hosts = nil
  @initial_hosts = @hosts.clone if !load_only

  true

# rescuing only those exceptions which are related to /etc/hosts access
# (e.g. corrupted file, file access error, ...)
rescue IOError, SystemCallError, RuntimeError => e
  log.error("Loading /etc/hosts failed with exception #{e.inspect}")

  # get clean environment, crashing due to exception is no option here
  @hosts = CFA::Hosts.new
  @initial_hosts = nil

  # reraise the exception - let the gui takes care of it
  raise
end

#settingsObject



208
209
210
# File 'src/lib/network/clients/network_proposal.rb', line 208

def settings
  Y2Network::ProposalSettings.instance
end