Ejemplo n.º 1
0
    def install_with_tasks(self):
        """Return the installation tasks of this module.

        :returns: list of object paths of installation tasks
        """
        tasks = [
            ConfigureInitialSetupTask(
                sysroot=conf.target.system_root,
                setup_on_boot=self.setup_on_boot
            ),
            ConfigurePostInstallationToolsTask(
                sysroot=conf.target.system_root,
                tools_enabled=self.post_install_tools_enabled
            ),
            ConfigureServicesTask(
                sysroot=conf.target.system_root,
                disabled_services=self.disabled_services,
                enabled_services=self.enabled_services
            ),
            ConfigureSystemdDefaultTargetTask(
                sysroot=conf.target.system_root,
                default_target=self.default_target
            ),
            ConfigureDefaultDesktopTask(
                sysroot=conf.target.system_root,
                default_desktop=self.default_desktop
            ),
        ]

        paths = [
            self.publish_task(SERVICES.namespace, task) for task in tasks
        ]

        return paths
Ejemplo n.º 2
0
    def install_with_tasks(self):
        """Return the installation tasks of this module.

        :returns: list of installation tasks
        """
        return [
            ConfigureInitialSetupTask(
                sysroot=conf.target.system_root,
                setup_on_boot=self.setup_on_boot
            ),
            ConfigurePostInstallationToolsTask(
                sysroot=conf.target.system_root,
                tools_enabled=self.post_install_tools_enabled
            ),
            ConfigureServicesTask(
                sysroot=conf.target.system_root,
                disabled_services=self.disabled_services,
                enabled_services=self.enabled_services
            ),
            ConfigureSystemdDefaultTargetTask(
                sysroot=conf.target.system_root,
                default_target=self.default_target
            ),
            ConfigureDefaultDesktopTask(
                sysroot=conf.target.system_root,
                default_desktop=self.default_desktop
            ),
        ]
Ejemplo n.º 3
0
    def install_with_tasks(self, sysroot):
        """Return the installation tasks of this module.

        :param str sysroot: a path to the root of the installed system
        :returns: list of object paths of installation tasks
        """
        tasks = [
            ConfigureInitialSetupTask(
                sysroot=sysroot,
                setup_on_boot=self.setup_on_boot
            ),
            ConfigurePostInstallationToolsTask(
                sysroot=sysroot,
                tools_enabled=self.post_install_tools_enabled
            ),
            ConfigureServicesTask(
                sysroot=sysroot,
                disabled_services=self.disabled_services,
                enabled_services=self.enabled_services
            ),
        ]

        paths = [
            self.publish_task(SERVICES.namespace, task) for task in tasks
        ]

        return paths
Ejemplo n.º 4
0
    def test_enable_post_install_tools(self, version_getter):
        version_getter.return_value = "1.0"

        content = dedent("""
        # This file has been generated by the Anaconda Installer 1.0

        [General]
        post_install_tools_disabled = 0
        """)

        with tempfile.TemporaryDirectory() as sysroot:
            os.makedirs(os.path.join(sysroot, "etc/sysconfig"))

            ConfigurePostInstallationToolsTask(sysroot=sysroot,
                                               tools_enabled=True).run()

            with open(os.path.join(sysroot, "etc/sysconfig/anaconda")) as f:
                assert f.read().strip() == content.strip()
Ejemplo n.º 5
0
    def test_skip_post_install_tools(self, conf):
        with tempfile.TemporaryDirectory() as sysroot:
            os.makedirs(os.path.join(sysroot, "etc/sysconfig"))

            task = ConfigurePostInstallationToolsTask(sysroot=sysroot,
                                                      tools_enabled=True)

            conf.target.is_directory = False
            conf.target.is_image = True
            task.run()

            assert not os.path.isfile(
                os.path.join(sysroot, "etc/sysconfig/anaconda"))

            conf.target.is_directory = True
            conf.target.is_image = False
            task.run()

            assert not os.path.isfile(
                os.path.join(sysroot, "etc/sysconfig/anaconda"))