pyanaconda.modules.network.network_interface

Classes

NetworkInitializationTaskInterface

The interface for a network configuration initialization task

NetworkInterface

DBus interface for Network module.

Module Contents

class pyanaconda.modules.network.network_interface.NetworkInitializationTaskInterface[source]

Bases: pyanaconda.modules.common.task.TaskInterface

The interface for a network configuration initialization task

Such a task returns a list of names of the devices the task has affected.

static convert_result(value)[source]

Convert the value of the result.

Convert the value into a variant.

Parameters:

value – a value of the result

Returns:

a variant with the value

Raises:

NoResultError by default

class pyanaconda.modules.network.network_interface.NetworkInterface[source]

Bases: pyanaconda.modules.common.base.KickstartModuleInterface

DBus interface for Network module.

connect_signals()[source]

Connect the signals.

property Hostname: Str[source]

Hostname the system will use.

Return type:

Str

CurrentHostnameChanged(hostname)[source]

Signal current hostname change.

Parameters:

hostname (Str)

GetCurrentHostname()[source]

Current system hostname.

Return type:

Str

SetCurrentHostname(hostname)[source]

Set current system hostname.

Sets the hostname of installer environment.

param: hostname: a string with a hostname

Parameters:

hostname (Str)

property Connected: Bool[source]

Is the system connected to the network?

The system is considered to be connected if being in one of the states NM_STATE_CONNECTED_LOCAL, NM_STATE_CONNECTED_SITE or NM_STATE_CONNECTED_GLOBAL.

Return type:

Bool

IsConnecting()[source]

Is NewtorkManager in connecting state?

The connecting state can indicate that dhcp configuration is in progress.

The state corresponds to NM_STATE_CONNECTING.

Internal API used for networking initialization and synchronization. To be removed after reworking the synchronization.

Return type:

Bool

property Capabilities: List[Int][source]

The network backend capabilities

Supported capabilities: team capability = 1

Return type:

List[Int]

GetSupportedDevices()[source]

Get info about existing network devices supported by the module.

Returns:

list of objects describing supported devices found on the system

Return type:

List[Structure]

GetActivatedInterfaces()[source]

Get activated network interfaces.

Device is considered as activated if it has an active network (NM) connection.

Returns:

list of names of devices having active network connection

Return type:

List[Str]

InstallNetworkWithTask(overwrite)[source]

Install network with an installation task.

FIXME: does overwrite still apply? :param overwrite: overwrite existing configuration :return: a DBus path of an installation task

Parameters:

overwrite (Bool)

Return type:

ObjPath

ConfigureHostnameWithTask(overwrite)[source]

Configure hostname with an installation task.

FIXME: does overwrite still apply? :param overwrite: overwrite existing configuration :return: a DBus path of an installation task

Parameters:

overwrite (Bool)

Return type:

ObjPath

ConfigureActivationOnBootWithTask(onboot_ifaces)[source]

Configure automatic activation of devices on system boot.

  1. Specified devices are set to be activated automatically.

  2. Policy set in anaconda configuration (default_on_boot) is applied.

Parameters:

onboot_ifaces (List[Str]) – list of network interfaces which should have ONBOOT=yes

Return type:

ObjPath

CreateDeviceConfigurations()[source]

Create and populate the state of network devices configuration.

GetDeviceConfigurations()[source]

Get the state of network devices configuration.

Contains only configuration of devices supported by Anaconda.

Returns list of NetworkDeviceConfiguration objects holding configuration of a network device.

For a physical device there is only single NetworkDeviceConfiguration object bound to the device name (the mandatory persistent element of the object). The uuid corresponds to the configuration of the device for installed system.

For a virtual device there can be multiple NetworkDeviceConfiguration objects, bound to uuid of the device configuration (the mandatory persistent element of the object). The device name is set in the object only if there exists respective active device with the configuration given by uuid applied.

Configurations correspond to NetworkManager persistent connections by their uuid.

Return type:

List[Structure]

_device_configurations_changed(changes)[source]
DeviceConfigurationChanged(changes)[source]

Signal change of network devices configurations.

Parameters:

changes (List[Tuple[Structure, Structure]])

ApplyKickstartWithTask()[source]

Apply kickstart configuration which has not already been applied.

  • activate configurations created in initramfs if –activate is True

  • create configurations for %pre kickstart commands and activate eventually

Returns:

DBus path of the task applying the kickstart

Return type:

ObjPath

PersistInitramfsConfigWithTask()[source]

Make configuration created in initramfs persistent.

In initramfs the configuration can be created via boot options or by kickstart.

Only configuration bound to an interface is persisted. For example configuration created based on ip=dhcp option is not.

Returns:

DBus path of the task dumping the files

Return type:

ObjPath

NetworkDeviceConfigurationChanged()[source]

Inform module that network device configuration might have changed.

Therefore kickstart for device configurations should be generated from persistent configuration instead of using original kickstart data.

GetDracutArguments(iface, target_ip, hostname, ibft)[source]

Get dracut arguments for the iface and iSCSI target.

The dracut arguments would activate the iface in initramfs so that the iSCSI target can be attached (for example to mount root filesystem).

Parameters:
  • iface (Str) – network interface used to connect to the target

  • target_ip (Str) – IP of the iSCSI target

  • hostname (Str) – static hostname to be configured

  • ibft (Bool) – the device should be configured from iBFT

Return type:

List[Str]

LogConfigurationState(msg_header)[source]

Logs the state of network configuration.

Parameters:

msg_header (Str) – header of the log messages