Exemplo n.º 1
0
    def install_network_with_task(self, sysroot, onboot_ifaces, overwrite):
        """Install network with an installation task.

        :param sysroot: a path to the root of the installed system
        :param onboot_ifaces: list of network interfaces which should have ONBOOT=yes
        :param overwrite: overwrite existing configuration
        :return: a DBus path of an installation task
        """
        disable_ipv6 = self.disable_ipv6 and devices_ignore_ipv6(
            self.nm_client, supported_wired_device_types)
        network_ifaces = [
            device.get_iface() for device in self.nm_client.get_devices()
        ]

        onboot_ifaces_by_policy = []
        if self._should_apply_onboot_policy() and \
                not self._has_any_onboot_yes_device(self._device_configurations):
            onboot_ifaces_by_policy = self._get_onboot_ifaces_by_policy(
                conf.network.default_on_boot)
        all_onboot_ifaces = list(set(onboot_ifaces + onboot_ifaces_by_policy))
        self._onboot_yes_ifaces = all_onboot_ifaces
        onboot_yes_uuids = [
            find_ifcfg_uuid_of_device(self.nm_client, iface) or ""
            for iface in all_onboot_ifaces
        ]
        log.debug("ONBOOT will be set to yes for %s (fcoe) %s (policy)",
                  onboot_ifaces, onboot_ifaces_by_policy)

        task = NetworkInstallationTask(sysroot, self.hostname, disable_ipv6,
                                       overwrite, onboot_yes_uuids,
                                       network_ifaces)
        task.succeeded_signal.connect(
            lambda: self.log_task_result(task, root_path=sysroot))
        path = self.publish_task(NETWORK.namespace, task)
        return path
Exemplo n.º 2
0
    def install_network_with_task(self, overwrite):
        """Install network with an installation task.

        :param overwrite: overwrite existing configuration
        :return: a DBus path of an installation task
        """
        disable_ipv6 = False
        network_ifaces = []
        if self.nm_available:
            disable_ipv6 = self.disable_ipv6 and devices_ignore_ipv6(self.nm_client,
                                                                     supported_wired_device_types)
            network_ifaces = [device.get_iface() for device in self.nm_client.get_devices()]

        task = NetworkInstallationTask(
            conf.target.system_root,
            disable_ipv6,
            overwrite,
            network_ifaces,
            self.ifname_option_values,
            self._is_using_persistent_device_names(kernel_arguments)
        )

        task.succeeded_signal.connect(
            lambda: self.log_task_result(task, root_path=conf.target.system_root)
        )
        return task