Ejemplo n.º 1
0
    def on_format_clicked(self, *args):
        """
        Once the format button is clicked, the option to cancel expires.
        We also need to display the spinner showing activity.
        """
        self._cancel_button.set_sensitive(False)
        self._ok_button.set_sensitive(False)
        self._notebook.set_current_page(1)

        # Loop through all of our unformatted DASDs and format them
        threadMgr.add(
            AnacondaThread(name=constants.THREAD_DASDFMT,
                           target=self.run_dasdfmt,
                           args=(self._epoch, )))

        # Need to make devicetree aware of storage change
        threadMgr.add(
            AnacondaThread(name=constants.THREAD_STORAGE,
                           target=storageInitialize,
                           args=(self.storage, self.data,
                                 self.storage.devicetree.protectedDevNames)))

        # And update (re-create) the storage snapshot to reflect these changes
        threadMgr.wait(constants.THREAD_STORAGE)
        if on_disk_storage.created:
            on_disk_storage.dispose_snapshot()
        on_disk_storage.create_snapshot(self.storage)
Ejemplo n.º 2
0
    def apply(self):
        applyDiskSelection(self.storage, self.data, self.selected_disks)

        # some disks may have been added in this spoke, we need to recreate the
        # snapshot of on-disk storage
        if on_disk_storage.created:
            on_disk_storage.dispose_snapshot()
        on_disk_storage.create_snapshot(self.storage)
Ejemplo n.º 3
0
    def apply(self):
        applyDiskSelection(self.storage, self.data, self.selected_disks)

        # some disks may have been added in this spoke, we need to recreate the
        # snapshot of on-disk storage
        if on_disk_storage.created:
            on_disk_storage.dispose_snapshot()
        on_disk_storage.create_snapshot(self.storage)
Ejemplo n.º 4
0
    def apply(self):
        onlyuse = self.selected_disks[:]
        for disk in [d for d in self.storage.disks if d.name in onlyuse]:
            onlyuse.extend([d.name for d in disk.ancestors
                                        if d.name not in onlyuse])

        self.data.ignoredisk.onlyuse = onlyuse
        self.data.clearpart.drives = self.selected_disks[:]

        # some disks may have been added in this spoke, we need to recreate the
        # snapshot of on-disk storage
        if on_disk_storage.created:
            on_disk_storage.dispose_snapshot()
        on_disk_storage.create_snapshot(self.storage)
Ejemplo n.º 5
0
    def apply(self):
        onlyuse = self.selected_disks[:]
        for disk in [d for d in self.storage.disks if d.name in onlyuse]:
            onlyuse.extend([d.name for d in disk.ancestors
                                        if d.name not in onlyuse])

        self.data.ignoredisk.onlyuse = onlyuse
        self.data.clearpart.drives = self.selected_disks[:]

        # some disks may have been added in this spoke, we need to recreate the
        # snapshot of on-disk storage
        if on_disk_storage.created:
            on_disk_storage.dispose_snapshot()
        on_disk_storage.create_snapshot(self.storage)
Ejemplo n.º 6
0
    def run(self, storage, data):
        """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"))
        storage_initialize(storage, data, storage.protected_dev_names)

        # Update also the storage snapshot to reflect the changes.
        if on_disk_storage.created:
            on_disk_storage.dispose_snapshot()
        on_disk_storage.create_snapshot(storage)