Beispiel #1
0
    def setUp(self):
        self.storage = InstallerStorage()

        # anaconda first configures disk images
        for (name, size) in iter(self.disks.items()):
            path = util.create_sparse_tempfile(name, size)
            self.storage.disk_images[name] = path

        # at this point the DMLinearDevice has correct size
        self.storage.setup_disk_images()

        # anaconda calls initialize_storage regardless of whether or not
        # this is an image install. Somewhere along the line this will
        # execute setup_disk_images() once more and the DMLinearDevice created
        # in this second execution has size 0
        with patch('blivet.flags'):
            reset_storage()
Beispiel #2
0
    def _rescan_devices(self):
        """Rescan devices."""
        text = _("Warning: This will revert all changes done so far.\n"
                 "Do you want to proceed?\n")

        question_window = YesNoDialog(text)
        ScreenHandler.push_screen_modal(question_window)

        if not question_window.answer:
            return

        print(_("Scanning disks. This may take a moment..."))
        reset_storage(scan_all=True)

        # Forget the mount point requests.
        self._partitioning.SetRequests([])
        self._requests = self._gather_requests()
Beispiel #3
0
    def run(self):
        """Format all found DASDs and update the storage.

        This method could be run in a separate thread.
        """
        # Check if we have something to format.
        if not self._dasds:
            self.report.emit(_("Nothing to format"))
            return

        # Format all found DASDs.
        self.report.emit(_("Formatting DASDs"))
        self.do_format()

        # Update the storage.
        self.report.emit(_("Probing storage"))
        reset_storage()
Beispiel #4
0
    def _ensure_init_storage(self):
        """
        If a different clearpart type was chosen or mount point assignment was
        chosen instead, we need to reset/rescan storage to revert all changes
        done by the previous run of doKickstartStorage() and get everything into
        the initial state.
        """
        # the only safe options are:
        # 1) if nothing was set before (self._orig_clearpart_type is None) or
        if self._orig_init_mode == CLEAR_PARTITIONS_DEFAULT:
            return

        # 2) mount point assignment was done before and user just wants to tweak it
        if self._orig_part_method == self._part_method == PARTITIONING_METHOD_MANUAL:
            return

        # else
        print(_("Reverting previous configuration. This may take a moment..."))
        reset_storage(scan_all=True)
Beispiel #5
0
 def _reset_storage(self):
     reset_storage(scan_all=True)