Merge "Update ldap exceptions to pass correct kwargs."
This commit is contained in:
commit
f112873e05
@ -183,9 +183,8 @@ class BaseLdap(object):
|
|||||||
|
|
||||||
def create(self, values):
|
def create(self, values):
|
||||||
if not self.allow_create:
|
if not self.allow_create:
|
||||||
msg = _('LDAP backend does not allow %s create') \
|
action = _('LDAP %s create') % self.options_name
|
||||||
% self.options_name
|
raise exception.ForbiddenAction(action=action)
|
||||||
raise exception.ForbiddenAction(msg)
|
|
||||||
|
|
||||||
conn = self.get_connection()
|
conn = self.get_connection()
|
||||||
object_classes = self.structural_classes + [self.object_class]
|
object_classes = self.structural_classes + [self.object_class]
|
||||||
@ -290,9 +289,8 @@ class BaseLdap(object):
|
|||||||
|
|
||||||
def update(self, id, values, old_obj=None):
|
def update(self, id, values, old_obj=None):
|
||||||
if not self.allow_update:
|
if not self.allow_update:
|
||||||
msg = _('LDAP backend does not allow %s update') \
|
action = _('LDAP %s update') % self.options_name
|
||||||
% self.options_name
|
raise exception.ForbiddenAction(action=action)
|
||||||
raise exception.ForbiddenAction(msg)
|
|
||||||
|
|
||||||
if old_obj is None:
|
if old_obj is None:
|
||||||
old_obj = self.get(id)
|
old_obj = self.get(id)
|
||||||
@ -318,9 +316,8 @@ class BaseLdap(object):
|
|||||||
|
|
||||||
def delete(self, id):
|
def delete(self, id):
|
||||||
if not self.allow_delete:
|
if not self.allow_delete:
|
||||||
msg = _('LDAP backend does not allow %s delete') \
|
action = _('LDAP %s delete') % self.options_name
|
||||||
% self.options_name
|
raise exception.ForbiddenAction(action=action)
|
||||||
raise exception.ForbiddenAction(msg)
|
|
||||||
|
|
||||||
conn = self.get_connection()
|
conn = self.get_connection()
|
||||||
conn.delete_s(self._id_to_dn(id))
|
conn.delete_s(self._id_to_dn(id))
|
||||||
|
Loading…
Reference in New Issue
Block a user