def _initialize(self): """Finish the initialization. This method is expected to run only once during the initialization. """ # Wait for storage. hubQ.send_message(self.__class__.__name__, _(constants.PAYLOAD_STATUS_PROBING_STORAGE)) threadMgr.wait(constants.THREAD_STORAGE) # Automatically format DASDs if allowed. disks = self._disk_select_module.GetUsableDisks() DasdFormatting.run_automatically(disks, self._show_dasdfmt_report) hubQ.send_message(self.__class__.__name__, _(constants.PAYLOAD_STATUS_PROBING_STORAGE)) # Update the selected disks. select_default_disks() # 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._check_required_passphrase() self.execute() else: self._ready = True hubQ.send_ready(self.__class__.__name__) # Report that the storage spoke has been initialized. self.initialize_done()
def _initialize(self): """ Secondary initialize so wait for the storage thread to complete before populating our disk list """ # Wait for storage. threadMgr.wait(THREAD_STORAGE) # Automatically format DASDs if allowed. disks = self._disk_select_module.GetUsableDisks() DasdFormatting.run_automatically(disks) # Update the selected disks. select_default_disks() # Storage is ready. self._ready = True # Report that the storage spoke has been initialized. self.initialize_done()
def _check_dasd_formats(self): # No change by default. rc = DASD_FORMAT_NO_CHANGE # Do nothing if unsupported. if not DasdFormatting.is_supported(): return rc # Allow to format DASDs. self._disk_init_module.FormatUnrecognizedEnabled = True self._disk_init_module.FormatLDLEnabled = True # Get selected disks. disks = filter_disks_by_names(self._available_disks, self._selected_disks) # Check if some of the disks should be formatted. dasd_formatting = DasdFormatting() dasd_formatting.search_disks(disks) if dasd_formatting.should_run(): # We want to apply current selection before running dasdfmt to # prevent this information from being lost afterward apply_disk_selection(self._selected_disks) # Run the dialog. dialog = DasdFormatDialog(self.data, dasd_formatting) ignoreEscape(dialog.window) rc = self.run_lightbox_dialog(dialog) return rc
def input(self, args, key): """Grab the disk choice and update things""" self.errors = [] if self._container.process_user_input(key): return InputState.PROCESSED_AND_REDRAW else: if key.lower() == Prompt.CONTINUE: if self._selected_disks: # Is DASD formatting supported? if DasdFormatting.is_supported(): # Wait for storage. threadMgr.wait(THREAD_STORAGE) # Allow to format DASDs. self._disk_init_module.SetFormatUnrecognizedEnabled( True) self._disk_init_module.SetFormatLDLEnabled(True) # Get selected disks. disks = filter_disks_by_names(self._available_disks, self._selected_disks) # Check if some of the disks should be formatted. dasd_formatting = DasdFormatting() dasd_formatting.search_disks(disks) if dasd_formatting.should_run(): # We want to apply current selection before running dasdfmt to # prevent this information from being lost afterward apply_disk_selection(self._selected_disks) # Run the dialog. self.run_dasdfmt_dialog(dasd_formatting) return InputState.PROCESSED_AND_REDRAW # make sure no containers were split up by the user's disk # selection report = ValidationReport.from_structure( self._disk_select_module.ValidateSelectedDisks( self._selected_disks)) self.errors.extend(report.get_messages()) if self.errors: # The disk selection has to make sense before we can # proceed. return InputState.PROCESSED_AND_REDRAW self.apply() new_spoke = PartTypeSpoke(self.data, self.storage, self.payload, self._storage_module, self._partitioning) ScreenHandler.push_screen_modal(new_spoke) self._partitioning = new_spoke.partitioning self.apply() self.execute() return InputState.PROCESSED_AND_CLOSE else: return super().input(args, key)