def unlock_device(self, device_name, passphrase): """Unlocks LUKS device.""" device_state = self._find_device_state(device_name) if device_state is None: # TODO: raise an exception? log.error("Can't find device to unlock %s", device_name) return False device = device_state.device device.format.passphrase = passphrase try: device.setup() device.format.setup() # Wait for the device. # Otherwise, we could get a message about no Linux partitions. time.sleep(2) try_populate_devicetree(self._storage.devicetree) except StorageError as serr: log.error("Failed to unlock %s: %s", device.name, serr) device.teardown(recursive=True) device.format.passphrase = None return False else: device_state.set_unlocked(passphrase) return True
def run(self): rc = self.window.run() self.window.destroy() # We need to call this to get the device nodes to show up # in our devicetree. if self._update_devicetree: try_populate_devicetree(self._storage.devicetree) return rc
def run(self): rc = self.window.run() self.window.destroy() # We need to call this to get the device nodes to show up # in our devicetree. if self._update_devicetree: try_populate_devicetree(self._storage.devicetree) return rc
def run(self): rc = self.window.run() self.window.destroy() if self._update_devicetree: try_populate_devicetree(self._storage.devicetree) return rc
def run(self): rc = self.window.run() self.window.destroy() if self._update_devicetree: try_populate_devicetree(self._storage.devicetree) return rc
def _create_snapshots(self, storage, requests, when): """Create the snapshots. :param storage: an instance of Blivet :param requests: a list of the snapshot requests :param when: when the snapshots are created """ if when == SNAPSHOT_WHEN_POST_INSTALL: try_populate_devicetree(storage.devicetree) for request in requests: self._create_snapshot(storage, request) if when == SNAPSHOT_WHEN_PRE_INSTALL: try_populate_devicetree(storage.devicetree)
def on_refresh_clicked(self, widget, *args): try_populate_devicetree(self.storage.devicetree) self.refresh()