1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

netcmd: silo member: rename exceptions to grant and revoke

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Rob van der Linde 2023-11-08 08:30:22 +13:00 committed by Andrew Bartlett
parent 422cc1d17d
commit 19613057d9
2 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@ from ldb import FLAG_MOD_ADD, FLAG_MOD_DELETE, LdbError, Message, MessageElement
from samba.sd_utils import escaped_claim_id
from .exceptions import AddMemberError, RemoveMemberError
from .exceptions import GrantMemberError, RevokeMemberError
from .fields import DnField, BooleanField, StringField
from .model import Model
@ -71,7 +71,7 @@ class AuthenticationSilo(Model):
try:
ldb.modify(message)
except LdbError as e:
raise AddMemberError(f"Failed to add silo member: {e}")
raise GrantMemberError(f"Failed to add silo member: {e}")
# If the modify operation was successful refresh members field.
self.refresh(ldb, fields=["members"])
@ -94,7 +94,7 @@ class AuthenticationSilo(Model):
try:
ldb.modify(message)
except LdbError as e:
raise RemoveMemberError(f"Failed to remove silo member: {e}")
raise RevokeMemberError(f"Failed to remove silo member: {e}")
# If the modify operation was successful refresh members field.
self.refresh(ldb, fields=["members"])

View File

@ -44,11 +44,11 @@ class DoesNotExist(ModelError):
pass
class AddMemberError(ModelError):
class GrantMemberError(ModelError):
pass
class RemoveMemberError(ModelError):
class RevokeMemberError(ModelError):
pass