def scan_all_devices()

in export/securedrop_export/disk/service.py [0:0]


    def scan_all_devices(self) -> Status:
        """
        Check all connected devices and return current device
        status.
        """
        try:
            volume = self.cli.get_volume()
            if isinstance(volume, MountedVolume):
                return Status.DEVICE_WRITABLE
            elif isinstance(volume, Volume):
                return Status.DEVICE_LOCKED
            else:
                # Above will return MountedVolume, Volume, or raise error;
                # this shouldn't be reachable
                raise ExportException(sdstatus=Status.DEVICE_ERROR)

        except ExportException as ex:
            logger.debug(ex)
            status = ex.sdstatus if ex.sdstatus is not None else Status.DEVICE_ERROR
            logger.error(f"Encountered {status.value} while checking volumes")
            return status