Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress reporting #145

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 11 additions & 73 deletions initial_setup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@

from initial_setup.product import eula_available
from initial_setup import initial_setup_log
from initial_setup.task import InitialSetupTask

from pyanaconda.core.dbus import DBus
from pyanaconda.core.util import get_os_release_value
from pyanaconda.localization import setup_locale_environment, setup_locale
from pyanaconda.core.constants import FIRSTBOOT_ENVIRON, SETUP_ON_BOOT_RECONFIG, \
SETUP_ON_BOOT_DEFAULT
from pyanaconda.core.constants import FIRSTBOOT_ENVIRON, SETUP_ON_BOOT_RECONFIG
from pyanaconda.flags import flags
from pyanaconda.core.startup.dbus_launcher import AnacondaDBusLauncher
from pyanaconda.modules.common.task import sync_run_task
from pyanaconda.modules.common.constants.services import BOSS, LOCALIZATION, TIMEZONE, USERS, \
from pyanaconda.modules.common.constants.services import BOSS, LOCALIZATION, USERS, \
SERVICES, NETWORK
from pyanaconda.modules.common.structures.kickstart import KickstartReport

Expand Down Expand Up @@ -282,74 +280,14 @@ def _apply(self):
# Do not execute sections that were part of the original
# anaconda kickstart file (== have .seen flag set)

log.info("applying changes")

services_proxy = SERVICES.get_proxy()
reconfig_mode = services_proxy.SetupOnBoot == SETUP_ON_BOOT_RECONFIG

# data.selinux
# data.firewall

# Configure the timezone.
timezone_proxy = TIMEZONE.get_proxy()
for task_path in timezone_proxy.InstallWithTasks():
task_proxy = TIMEZONE.get_proxy(task_path)
sync_run_task(task_proxy)

# Configure the localization.
localization_proxy = LOCALIZATION.get_proxy()
for task_path in localization_proxy.InstallWithTasks():
task_proxy = LOCALIZATION.get_proxy(task_path)
sync_run_task(task_proxy)

# Configure persistent hostname
network_proxy = NETWORK.get_proxy()
network_task = network_proxy.ConfigureHostnameWithTask(True)
task_proxy = NETWORK.get_proxy(network_task)
sync_run_task(task_proxy)
# Set current hostname
network_proxy.SetCurrentHostname(network_proxy.Hostname)

# Configure groups, users & root account
#
# NOTE: We only configure groups, users & root account if the respective
# kickstart commands are *not* seen in the input kickstart.
# This basically means that we will configure only what was
# set in the Initial Setup UI and will not attempt to configure
# anything that looks like it was configured previously in
# the Anaconda UI or installation kickstart.
users_proxy = USERS.get_proxy()

if self._groups_already_configured and not reconfig_mode:
log.debug("skipping user group configuration - already configured")
elif users_proxy.Groups: # only run of there are some groups to create
groups_task = users_proxy.ConfigureGroupsWithTask()
task_proxy = USERS.get_proxy(groups_task)
log.debug("configuring user groups via %s task", task_proxy.Name)
sync_run_task(task_proxy)

if self._users_already_configured and not reconfig_mode:
log.debug("skipping user configuration - already configured")
elif users_proxy.Users: # only run if there are some users to create
users_task = users_proxy.ConfigureUsersWithTask()
task_proxy = USERS.get_proxy(users_task)
log.debug("configuring users via %s task", task_proxy.Name)
sync_run_task(task_proxy)

if self._root_password_already_configured and not reconfig_mode:
log.debug("skipping root password configuration - already configured")
else:
root_task = users_proxy.SetRootPasswordWithTask()
task_proxy = USERS.get_proxy(root_task)
log.debug("configuring root password via %s task", task_proxy.Name)
sync_run_task(task_proxy)

# Configure all addons
log.info("executing addons")
boss_proxy = BOSS.get_proxy()
for service_name, object_path in boss_proxy.CollectInstallSystemTasks():
task_proxy = DBus.get_proxy(service_name, object_path)
sync_run_task(task_proxy)
if not self.gui_mode:
# GUI has it already executed, but in TUI do it here
task = InitialSetupTask(
groups_already_configured=self._groups_already_configured,
users_already_configured=self._users_already_configured,
root_password_already_configured=self._root_password_already_configured,
)
task.start()

if self.external_reconfig:
# prevent the reconfig flag from being written out
Expand Down
168 changes: 168 additions & 0 deletions initial_setup/gui/spokes/setup_progress.glade
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<requires lib="AnacondaWidgets" version="3.0"/>
<object class="AnacondaStandaloneWindow" id="progressWindow">
<property name="can_focus">False</property>
<property name="window_name" translatable="yes">INSTALLATION PROGRESS</property>
<child internal-child="main_box">
<object class="GtkBox" id="AnacondaStandaloneWindow-main_box1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child internal-child="nav_box">
<object class="GtkEventBox" id="AnacondaStandaloneWindow-nav_box1">
<property name="can_focus">False</property>
<child internal-child="nav_area">
<object class="GtkGrid" id="AnacondaStandaloneWindow-nav_area1">
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child internal-child="alignment">
<object class="GtkAlignment" id="AnacondaStandaloneWindow-alignment1">
<property name="can_focus">False</property>
<property name="yalign">0</property>
<property name="left_padding">12</property>
<property name="right_padding">6</property>
<child internal-child="action_area">
<object class="GtkBox" id="progressWindow-actionArea">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="progressBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="spacing">6</property>
<child>
<object class="GtkSpinner" id="progressSpinner">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="progressLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Preparing to install</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkProgressBar" id="progressBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="progressNotebook">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">end</property>
<property name="margin_bottom">10</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property>
<child>
<object class="GtkBox" id="emptyBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
</child>
<child>
<object class="GtkLabel" id="rebootLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">end</property>
<property name="label">%s is now successfully installed and ready for you to use!
Go ahead and reboot to start using it!</property>
<property name="justify">right</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child internal-child="accessible">
<object class="AtkObject" id="progressWindow-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">INSTALLATION PROGRESS</property>
</object>
</child>
</object>
</interface>
Loading