Ejemplo n.º 1
0
    def checkStorage(self):
        from pyanaconda.storage_utils import sanity_check, SanityError, SanityWarning

        threadMgr.wait(constants.THREAD_EXECUTE_STORAGE)

        hubQ.send_not_ready(self._mainSpokeClass)
        hubQ.send_message(self._mainSpokeClass, _("Checking storage configuration..."))
        exns = sanity_check(self.storage, min_ram=self._min_ram)
        errors = [str(exn) for exn in exns if isinstance(exn, SanityError)]
        warnings = [str(exn) for exn in exns if isinstance(exn, SanityWarning)]
        (StorageChecker.errors, StorageChecker.warnings) = (errors, warnings)
        hubQ.send_ready(self._mainSpokeClass, True)
        for e in StorageChecker.errors:
            self.log.error(e)
        for w in StorageChecker.warnings:
            self.log.warning(w)
Ejemplo n.º 2
0
 def execute(self):
     print(_("Generating updated storage configuration"))
     try:
         doKickstartStorage(self.storage, self.data, self.instclass)
     except (StorageError, KickstartValueError) as e:
         log.error("storage configuration failed: %s", e)
         print(_("storage configuration failed: %s") % e)
         self.errors = [str(e)]
         self.data.bootloader.bootDrive = ""
         self.data.clearpart.type = CLEARPART_TYPE_ALL
         self.data.clearpart.initAll = False
         self.storage.config.update(self.data)
         self.storage.autoPartType = self.data.autopart.type
         self.storage.reset()
         # now set ksdata back to the user's specified config
         applyDiskSelection(self.storage, self.data, self.selected_disks)
     except BootLoaderError as e:
         log.error("BootLoader setup failed: %s", e)
         print(_("storage configuration failed: %s") % e)
         self.errors = [str(e)]
         self.data.bootloader.bootDrive = ""
     else:
         print(_("Checking storage configuration..."))
         exns = sanity_check(self.storage)
         errors = [
             exn.message for exn in exns if isinstance(exn, SanityError)
         ]
         warnings = [
             exn.message for exn in exns if isinstance(exn, SanityWarning)
         ]
         (self.errors, self.warnings) = (errors, warnings)
         for e in self.errors:
             log.error(e)
             print(e)
         for w in self.warnings:
             log.warning(w)
             print(w)
     finally:
         resetCustomStorageData(self.data)
         self._ready = True
Ejemplo n.º 3
0
 def execute(self):
     print(_("Generating updated storage configuration"))
     try:
         doKickstartStorage(self.storage, self.data, self.instclass)
     except (StorageError, KickstartValueError) as e:
         log.error("storage configuration failed: %s", e)
         print(_("storage configuration failed: %s") % e)
         self.errors = [str(e)]
         self.data.bootloader.bootDrive = ""
         self.data.clearpart.type = CLEARPART_TYPE_ALL
         self.data.clearpart.initAll = False
         self.storage.config.update(self.data)
         self.storage.autoPartType = self.data.autopart.type
         self.storage.reset()
         # now set ksdata back to the user's specified config
         applyDiskSelection(self.storage, self.data, self.selected_disks)
     except BootLoaderError as e:
         log.error("BootLoader setup failed: %s", e)
         print(_("storage configuration failed: %s") % e)
         self.errors = [str(e)]
         self.data.bootloader.bootDrive = ""
     else:
         print(_("Checking storage configuration..."))
         exns = sanity_check(self.storage)
         errors = [str(exn) for exn in exns if isinstance(exn, SanityError)]
         warnings = [str(exn) for exn in exns if isinstance(exn, SanityWarning)]
         (self.errors, self.warnings) = (errors, warnings)
         for e in self.errors:
             log.error(e)
             print(e)
         for w in self.warnings:
             log.warning(w)
             print(w)
     finally:
         resetCustomStorageData(self.data)
         self._ready = True