diff options
author | David Lehman <dlehman@redhat.com> | 2012-10-11 18:44:10 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2012-10-12 09:24:55 -0500 |
commit | fbc7589a05c773824888c7e74dfc3826715ec432 (patch) | |
tree | b75cd8a097d5a06a3ae5c19bb26d431e4de26efd | |
parent | 1223f7b1159deb53240dd92a6c64a192f4eaa357 (diff) | |
download | anaconda-fbc7589a05c773824888c7e74dfc3826715ec432.tar.gz anaconda-fbc7589a05c773824888c7e74dfc3826715ec432.tar.xz anaconda-fbc7589a05c773824888c7e74dfc3826715ec432.zip |
Fall back to lvm autopart if the default fails. (#864708)
This will only help if the disks and/or their free regions are very
small.
-rw-r--r-- | pyanaconda/ui/gui/spokes/storage.py | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 95adede4c..c9773e63d 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -383,11 +383,35 @@ class StorageSpoke(NormalSpoke, StorageChecker): self.errors = str(e).split("\n") communication.send_message(self.__class__.__name__, _("Failed to save storage configuration...")) - self.data.clearpart.type = CLEARPART_TYPE_NONE - self.data.clearpart.initAll = False - self.storage.config.update(self.data) - self.storage.autoPartType = self.data.autopart.type - self.storage.reset() + original_type = self.data.autopart.type + if original_type != AUTOPART_TYPE_LVM: + communication.send_message(self.__class__.__name__, + _("Automatic partitioning failed...")) + log.info("trying with lvm...") + self.storage.reset() + communication.send_message(self.__class__.__name__, + _("Trying fallback configuration...")) + self.data.autopart.type = AUTOPART_TYPE_LVM + self.storage.autoPartType = AUTOPART_TYPE_LVM + try: + doKickstartStorage(self.storage, self.data, self.instclass) + except StorageError as e2: + log.error("lvm failed, too: %s" % e2) + else: + self.errors = [] + + if self.errors: + communication.send_message(self.__class__.__name__, + _("Failed to save storage configuration...")) + self.data.autopart.type = original_type + self.data.clearpart.type = CLEARPART_TYPE_NONE + self.data.clearpart.initAll = False + self.storage.config.update(self.data) + self.storage.autoPartType = original_type + self.storage.reset() + else: + self.run() # emulating success path below + self.disks = getDisks(self.storage.devicetree) else: if self.autopart: |