pyanaconda.modules.network.network_interface
Classes
The interface for a network configuration initialization task |
|
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.
- class pyanaconda.modules.network.network_interface.NetworkInterface[source]
Bases:
pyanaconda.modules.common.base.KickstartModuleInterface
DBus interface for Network module.
- CurrentHostnameChanged(hostname)[source]
Signal current hostname change.
- Parameters:
hostname (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.
Specified devices are set to be activated automatically.
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]
- 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
- DumpMissingConfigFilesWithTask()[source]
Dump missing default config file for wired devices.
Make sure each supported wired device has config file.
For default auto connections created by NM upon start (which happens in case of missing config file, eg the file was not created in initramfs) rename the in-memory connection using device name and dump it into config file.
If default auto connections are turned off by NM configuration (based on policy, eg on RHEL or server), the connection will be created by Anaconda and dumped into config file.
The connection id (and consequently config file name) is set to device name.
- 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]