improve error message if group does not exists
This commit is contained in:
parent
57e9b27ff8
commit
52c6ad548d
@ -142,7 +142,7 @@ def allow_member(
|
|||||||
) -> None:
|
) -> None:
|
||||||
source = source_folder / name
|
source = source_folder / name
|
||||||
if not source.exists():
|
if not source.exists():
|
||||||
msg = f"{name} does not exist in {source_folder}: "
|
msg = f"Cannot encrypt {group_folder.parent.name} for '{name}' group. '{name}' group does not exist in {source_folder}: "
|
||||||
msg += list_directory(source_folder)
|
msg += list_directory(source_folder)
|
||||||
raise ClanError(msg)
|
raise ClanError(msg)
|
||||||
group_folder.mkdir(parents=True, exist_ok=True)
|
group_folder.mkdir(parents=True, exist_ok=True)
|
||||||
@ -150,7 +150,7 @@ def allow_member(
|
|||||||
if user_target.exists():
|
if user_target.exists():
|
||||||
if not user_target.is_symlink():
|
if not user_target.is_symlink():
|
||||||
raise ClanError(
|
raise ClanError(
|
||||||
f"Cannot add user {name}. {user_target} exists but is not a symlink"
|
f"Cannot add user '{name}' to {group_folder.parent.name} secret. {user_target} exists but is not a symlink"
|
||||||
)
|
)
|
||||||
os.remove(user_target)
|
os.remove(user_target)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user