Loading poolpay/vault/Vault.py +19 −3 Original line number Diff line number Diff line from dataclasses import dataclass from pathlib import Path from subprocess import run from subprocess import CalledProcessError, run from uuid import uuid4 Loading Loading @@ -98,6 +98,23 @@ class Vault: def _umount(self) -> None: run(["sudo", "umount", f"{self.mountpoint.resolve()}"], check=True) @property def _is_mounted(self) -> bool: try: run( [ "findmnt", "--source", f"{self._mapper}", "--mountpoint", f"{self.mountpoint}", ], check=True, ) return True except CalledProcessError: return False def open(self, password: str) -> None: self._cryptsetup_open(password) self._mount() Loading @@ -108,5 +125,4 @@ class Vault: @property def is_open(self) -> bool: # TODO Parse the output of "mount" to see if our mapper is mounted at our mountpoint raise NotImplementedError() return self._is_mounted Loading
poolpay/vault/Vault.py +19 −3 Original line number Diff line number Diff line from dataclasses import dataclass from pathlib import Path from subprocess import run from subprocess import CalledProcessError, run from uuid import uuid4 Loading Loading @@ -98,6 +98,23 @@ class Vault: def _umount(self) -> None: run(["sudo", "umount", f"{self.mountpoint.resolve()}"], check=True) @property def _is_mounted(self) -> bool: try: run( [ "findmnt", "--source", f"{self._mapper}", "--mountpoint", f"{self.mountpoint}", ], check=True, ) return True except CalledProcessError: return False def open(self, password: str) -> None: self._cryptsetup_open(password) self._mount() Loading @@ -108,5 +125,4 @@ class Vault: @property def is_open(self) -> bool: # TODO Parse the output of "mount" to see if our mapper is mounted at our mountpoint raise NotImplementedError() return self._is_mounted