示例#1
0
    def reset(self, cleanup_only=False):
        """ Reset storage configuration to reflect actual system state.

            This will cancel any queued actions and rescan from scratch but not
            clobber user-obtained information like passphrases, iscsi config, &c

            :keyword cleanup_only: prepare the tree only to deactivate devices
            :type cleanup_only: bool

            See :meth:`devicetree.Devicetree.populate` for more information
            about the cleanup_only keyword argument.
        """
        # set up the disk images
        if conf.target.is_image:
            self.setup_disk_images()

        # save passphrases for luks devices so we don't have to reprompt
        self.encryption_passphrase = None
        for device in self.devices:
            if device.format.type == "luks" and device.format.exists:
                self.save_passphrase(device)

        super().reset(cleanup_only=cleanup_only)

        self.fsset = FSSet(self.devicetree)

        # Clear out attributes that refer to devices that are no longer in the tree.
        self.bootloader.reset()

        self._mark_protected_devices()

        self.roots = []
        self.roots = find_existing_installations(self.devicetree)
        self.dump_state("initial")
示例#2
0
    def reset(self, cleanup_only=False):
        """ Reset storage configuration to reflect actual system state.

            This will cancel any queued actions and rescan from scratch but not
            clobber user-obtained information like passphrases, iscsi config, &c

            :keyword cleanup_only: prepare the tree only to deactivate devices
            :type cleanup_only: bool

            See :meth:`devicetree.Devicetree.populate` for more information
            about the cleanup_only keyword argument.
        """
        # set up the disk images
        if conf.target.is_image:
            self.setup_disk_images()

        # save passphrases for luks devices so we don't have to reprompt
        self.encryption_passphrase = None
        for device in self.devices:
            if device.format.type == "luks" and device.format.exists:
                self.save_passphrase(device)

        super().reset(cleanup_only=cleanup_only)

        self.fsset = FSSet(self.devicetree)

        # Clear out attributes that refer to devices that are no longer in the tree.
        self.bootloader.reset()

        self._mark_protected_devices()

        self.roots = []
        self.roots = find_existing_installations(self.devicetree)
        self.dump_state("initial")
示例#3
0
    def find_roots(self):
        """List of found roots."""
        roots = find_existing_installations(self._storage.devicetree)

        if not roots:
            self.status = RescueModeStatus.ROOT_NOT_FOUND

        return roots
示例#4
0
    def find_roots(self):
        """List of found roots."""
        roots = find_existing_installations(self._storage.devicetree)

        if not roots:
            self.status = RescueModeStatus.ROOT_NOT_FOUND

        return roots
示例#5
0
    def run(self):
        """Run the task.

        :return: a list of data about found systems
        """
        return find_existing_installations(devicetree=self._devicetree)