Permalink
Browse files

Fix i18n of string templates.

Change-Id: I4ed11b43b8b1072094bd2b6f88687900c858bafe
  • Loading branch information...
1 parent e1abe0f commit f237a67026b330a17b3c937c746d601ca6e63b24 @YorikSar YorikSar committed Jan 15, 2013
@@ -18,9 +18,9 @@ def wrapper(self, context, **kwargs):
if not context['is_admin']:
action = 'identity:%s' % f.__name__
- LOG.debug(_('RBAC: Authorizing %s(%s)' % (
+ LOG.debug(_('RBAC: Authorizing %s(%s)') % (
action,
- ', '.join(['%s=%s' % (k, kwargs[k]) for k in kwargs]))))
+ ', '.join(['%s=%s' % (k, kwargs[k]) for k in kwargs])))
try:
token_ref = self.token_api.get_token(
@@ -333,11 +333,11 @@ def deleteTree(self, id):
class LdapWrapper(object):
def __init__(self, url):
- LOG.debug(_("LDAP init: url=%s", url))
+ LOG.debug(_("LDAP init: url=%s"), url)
self.conn = ldap.initialize(url)
def simple_bind_s(self, user, password):
- LOG.debug(_("LDAP bind: dn=%s", user))
+ LOG.debug(_("LDAP bind: dn=%s"), user)
return self.conn.simple_bind_s(user, password)
def add_s(self, dn, attrs):
@@ -348,15 +348,15 @@ def add_s(self, dn, attrs):
if kind != 'userPassword'
else ['****'])
for kind, values in ldap_attrs]
- LOG.debug(_('LDAP add: dn=%s, attrs=%s', dn, sane_attrs))
+ LOG.debug(_('LDAP add: dn=%s, attrs=%s'), dn, sane_attrs)
return self.conn.add_s(dn, ldap_attrs)
def search_s(self, dn, scope, query):
if LOG.isEnabledFor(logging.DEBUG):
- LOG.debug(_('LDAP search: dn=%s, scope=%s, query=%s',
+ LOG.debug(_('LDAP search: dn=%s, scope=%s, query=%s'),
dn,
scope,
- query))
+ query)
res = self.conn.search_s(dn, scope, query)
o = []
@@ -376,14 +376,14 @@ def modify_s(self, dn, modlist):
sane_modlist = [(op, kind, (values if kind != 'userPassword'
else ['****']))
for op, kind, values in ldap_modlist]
- LOG.debug(_("LDAP modify: dn=%s, modlist=%s", dn, sane_modlist))
+ LOG.debug(_("LDAP modify: dn=%s, modlist=%s"), dn, sane_modlist)
return self.conn.modify_s(dn, ldap_modlist)
def delete_s(self, dn):
- LOG.debug(_("LDAP delete: dn=%s", dn))
+ LOG.debug(_("LDAP delete: dn=%s"), dn)
return self.conn.delete_s(dn)
def delete_ext_s(self, dn, serverctrls):
- LOG.debug(_("LDAP delete_ext: dn=%s, serverctrls=%s", dn, serverctrls))
+ LOG.debug(_("LDAP delete_ext: dn=%s, serverctrls=%s"), dn, serverctrls)
return self.conn.delete_ext_s(dn, serverctrls)
View
@@ -90,8 +90,8 @@ def generate(self, credentials):
credentials['verb'],
credentials['host'],
credentials['path'])
- raise Exception(_('Unknown Signature Version: %s' %
- credentials['params']['SignatureVersion']))
+ raise Exception(_('Unknown Signature Version: %s') %
+ credentials['params']['SignatureVersion'])
@staticmethod
def _get_utf8_value(value):
@@ -748,7 +748,7 @@ def add_user(self, role_id, user_id, tenant_id=None):
raise exception.Conflict(type='role grant', details=msg)
except ldap.NO_SUCH_OBJECT:
if tenant_id is None or self.get(role_id) is None:
- raise Exception(_("Role %s not found" % (role_id,)))
+ raise Exception(_("Role %s not found") % (role_id,))
attrs = [('objectClass', [self.object_class]),
(self.member_attribute, [user_dn])]

0 comments on commit f237a67

Please sign in to comment.