From 05d28a1b552ec728e8c91eb37fa2a5fdc00ae835 Mon Sep 17 00:00:00 2001 From: Vendula Poncova Date: May 17 2021 14:46:04 +0000 Subject: Don't automatically execute the default partitioning (#1954408) We should automatically execute only a partitioning that was already configured by the user, for example with a kickstart file. (cherry picked from commit f5bcaf6) Resolves: rhbz#1954408 --- diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 35b577f..afe1df4 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -260,6 +260,9 @@ class StorageSpoke(NormalSpoke, StorageCheckHandler): self._selected_disks = [] self._last_selected_disks = [] + # Is the partitioning already configured? + self._is_preconfigured = bool(self._storage_module.CreatedPartitioning) + # Find a partitioning to use. self._partitioning = find_partitioning() self._last_partitioning_method = self._partitioning.PartitioningMethod @@ -634,9 +637,10 @@ class StorageSpoke(NormalSpoke, StorageCheckHandler): # Update the selected disks. select_default_disks() - # Apply the partitioning. Do not set ready in the automated - # installation before the execute method is run. - if flags.automatedInstall: + # Automatically apply the preconfigured partitioning. + # Do not set ready in the automated installation before + # the execute method is run. + if flags.automatedInstall and self._is_preconfigured: self.execute() else: self._ready = True diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index 570ddc8..2c41a82 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -91,6 +91,11 @@ class StorageSpoke(NormalTUISpoke): self._available_disks = [] self._selected_disks = [] + + # Is the partitioning already configured? + self._is_preconfigured = bool(self._storage_module.CreatedPartitioning) + + # Find a partitioning to use. self._partitioning = find_partitioning() self.errors = [] @@ -408,8 +413,8 @@ class StorageSpoke(NormalTUISpoke): # Update the selected disks. select_default_disks() - # Apply the partitioning in the automated installation. - if flags.automatedInstall: + # Automatically apply the preconfigured partitioning. + if flags.automatedInstall and self._is_preconfigured: self.execute() # Storage is ready.