inline all messages
This commit is contained in:
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
from pathlib import Path
|
||||
|
||||
from ._core import CommandInterface
|
||||
from ..messages import MAPPER_ENTRY_ALREADY_EXISTS, CANNOT_FIND_DEVICE_PATH
|
||||
from ..misc import MAPPER_PATH, DISK_BY_UUID
|
||||
|
||||
|
||||
@@ -31,8 +30,7 @@ class Cryptsetup(CommandInterface):
|
||||
if cls._mapper_entry_in_use(mapper_entry):
|
||||
if cls._already_decrypted(path, mapper_entry):
|
||||
return True
|
||||
print(MAPPER_ENTRY_ALREADY_EXISTS)
|
||||
raise FileExistsError()
|
||||
raise FileExistsError("mapper entry already exists")
|
||||
cls._run_command(cls._Subcommands.open, str(path), mapper_entry)
|
||||
return False
|
||||
|
||||
@@ -71,8 +69,9 @@ class Cryptsetup(CommandInterface):
|
||||
device = Path(line.split(":")[-1].strip())
|
||||
break
|
||||
else:
|
||||
raise FileNotFoundError(CANNOT_FIND_DEVICE_PATH)
|
||||
# noinspection PyUnboundLocalVariable
|
||||
raise FileNotFoundError(
|
||||
"Cannot find device path from output of `cryptsetup status`"
|
||||
)
|
||||
return device
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user