def _do_check(self): self.clear_errors() StorageCheckHandler.errors = [] StorageCheckHandler.warnings = [] # We can't overwrite the main Storage instance because all the other # spokes have references to it that would get invalidated, but we can # achieve the same effect by updating/replacing a few key attributes. self.storage.devicetree._devices = self._storage_playground.devicetree._devices self.storage.devicetree._actions = self._storage_playground.devicetree._actions self.storage.devicetree._hidden = self._storage_playground.devicetree._hidden self.storage.devicetree.names = self._storage_playground.devicetree.names self.storage.roots = self._storage_playground.roots # set up bootloader and check the configuration try: configure_storage(self.storage, interactive=True) except BootloaderConfigurationError as e: StorageCheckHandler.errors = str(e).split("\n") reset_bootloader(self.storage) StorageCheckHandler.checkStorage(self) if self.errors: self.set_warning(_("Error checking storage configuration. <a href=\"\">Click for details</a> or press Done again to continue.")) elif self.warnings: self.set_warning(_("Warning checking storage configuration. <a href=\"\">Click for details</a> or press Done again to continue.")) # on_info_bar_clicked requires self._error to be set, so set it to the # list of all errors and warnings that storage checking found. self._error = "\n".join(self.errors + self.warnings) return self._error == ""
def _do_check(self): self.clear_errors() StorageCheckHandler.errors = [] StorageCheckHandler.warnings = [] # We can't overwrite the main Storage instance because all the other # spokes have references to it that would get invalidated, but we can # achieve the same effect by updating/replacing a few key attributes. self.storage.devicetree._devices = self._storage_playground.devicetree._devices self.storage.devicetree._actions = self._storage_playground.devicetree._actions self.storage.devicetree._hidden = self._storage_playground.devicetree._hidden self.storage.devicetree.names = self._storage_playground.devicetree.names self.storage.roots = self._storage_playground.roots # set up bootloader and check the configuration try: configure_storage(self.storage, interactive=True) except BootloaderConfigurationError as e: StorageCheckHandler.errors = str(e).split("\n") reset_bootloader(self.storage) StorageCheckHandler.checkStorage(self) if self.errors: self.set_warning(_("Error checking storage configuration. <a href=\"\">Click for details</a> or press Done again to continue.")) elif self.warnings: self.set_warning(_("Warning checking storage configuration. <a href=\"\">Click for details</a> or press Done again to continue.")) # on_info_bar_clicked requires self._error to be set, so set it to the # list of all errors and warnings that storage checking found. self._error = "\n".join(self.errors + self.warnings) return self._error == ""
def apply(self): self._auto_part_enabled = self._auto_part_observer.proxy.Enabled for disk in self._available_disks: if disk.name not in self._selected_disks and \ disk in self.storage.devices: self.storage.devicetree.hide(disk) elif disk.name in self._selected_disks and \ disk not in self.storage.devices: self.storage.devicetree.unhide(disk) self._bootloader_observer.proxy.SetPreferredLocation( BOOTLOADER_LOCATION_MBR) boot_drive = self._bootloader_observer.proxy.Drive if boot_drive and boot_drive not in self._selected_disks: reset_bootloader(self.storage) apply_disk_selection(self.storage, self._selected_disks) update_storage_config(self.storage.config) # If autopart is selected we want to remove whatever has been # created/scheduled to make room for autopart. # If custom is selected, we want to leave alone any storage layout the # user may have set up before now. self.storage.config.clear_non_existent = self._auto_part_observer.proxy.Enabled
def apply(self): self._auto_part_enabled = self._auto_part_module.Enabled self.storage.select_disks(self._selected_disks) self._bootloader_module.SetPreferredLocation(BOOTLOADER_LOCATION_MBR) boot_drive = self._bootloader_module.Drive if boot_drive and boot_drive not in self._selected_disks: reset_bootloader(self.storage) apply_disk_selection(self.storage, self._selected_disks)
def apply(self): self._auto_part_enabled = self._auto_part_observer.proxy.Enabled self.storage.select_disks(self._selected_disks) self._bootloader_observer.proxy.SetPreferredLocation(BOOTLOADER_LOCATION_MBR) boot_drive = self._bootloader_observer.proxy.Drive if boot_drive and boot_drive not in self._selected_disks: reset_bootloader(self.storage) apply_disk_selection(self.storage, self._selected_disks)
def execute(self): print(_("Generating updated storage configuration")) try: configure_storage(self.storage, self.data) except StorageConfigurationError as e: print(_("storage configuration failed: %s") % e) self.errors = [str(e)] reset_bootloader(self.storage) reset_storage(self.storage, scan_all=True) except BootloaderConfigurationError as e: print(_("storage configuration failed: %s") % e) self.errors = [str(e)] reset_bootloader(self.storage) else: print(_("Checking storage configuration...")) report = storage_checker.check(self.storage) print("\n".join(report.all_errors)) report.log(log) self.errors = report.errors self.warnings = report.warnings finally: reset_custom_storage_data(self.data) self._ready = True
def execute(self): print(_("Generating updated storage configuration")) try: configure_storage(self.storage, self.data) except StorageConfigurationError as e: print(_("storage configuration failed: %s") % e) self.errors = [str(e)] reset_bootloader(self.storage) reset_storage(self.storage, scan_all=True) except BootloaderConfigurationError as e: print(_("storage configuration failed: %s") % e) self.errors = [str(e)] reset_bootloader(self.storage) else: print(_("Checking storage configuration...")) report = storage_checker.check(self.storage) print("\n".join(report.all_errors)) report.log(log) self.errors = report.errors self.warnings = report.warnings finally: reset_custom_storage_data(self.data) self._ready = True