Permalink
Browse files

Merge "Update ldap exceptions to pass correct kwargs."

  • Loading branch information...
2 parents 08a6859 + 2c1785a commit f112873e05a0d33f6d661e8355e6eeb7629b12b3 Jenkins committed with openstack-gerrit Jan 14, 2013
Showing with 6 additions and 9 deletions.
  1. +6 −9 keystone/common/ldap/core.py
@@ -183,9 +183,8 @@ def affirm_unique(self, values):
def create(self, values):
if not self.allow_create:
- msg = _('LDAP backend does not allow %s create') \
- % self.options_name
- raise exception.ForbiddenAction(msg)
+ action = _('LDAP %s create') % self.options_name
+ raise exception.ForbiddenAction(action=action)
conn = self.get_connection()
object_classes = self.structural_classes + [self.object_class]
@@ -290,9 +289,8 @@ def _get_page_markers(marker, limit, lst, key=lambda x: x.id):
def update(self, id, values, old_obj=None):
if not self.allow_update:
- msg = _('LDAP backend does not allow %s update') \
- % self.options_name
- raise exception.ForbiddenAction(msg)
+ action = _('LDAP %s update') % self.options_name
+ raise exception.ForbiddenAction(action=action)
if old_obj is None:
old_obj = self.get(id)
@@ -318,9 +316,8 @@ def update(self, id, values, old_obj=None):
def delete(self, id):
if not self.allow_delete:
- msg = _('LDAP backend does not allow %s delete') \
- % self.options_name
- raise exception.ForbiddenAction(msg)
+ action = _('LDAP %s delete') % self.options_name
+ raise exception.ForbiddenAction(action=action)
conn = self.get_connection()
conn.delete_s(self._id_to_dn(id))

0 comments on commit f112873

Please sign in to comment.