il8n some strings
il8n some more missing strings. Change-Id: I56d1d83093c8a5e895571e2d2db41c7600662754 Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:
parent
76af49f11a
commit
0e5533eb6f
@ -18,15 +18,15 @@ def protected(f):
|
||||
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(
|
||||
context=context, token_id=context['token_id'])
|
||||
except exception.TokenNotFound:
|
||||
LOG.warning('RBAC: Invalid token')
|
||||
LOG.warning(_('RBAC: Invalid token'))
|
||||
raise exception.Unauthorized()
|
||||
|
||||
creds = token_ref['metadata'].copy()
|
||||
@ -34,13 +34,13 @@ def protected(f):
|
||||
try:
|
||||
creds['user_id'] = token_ref['user'].get('id')
|
||||
except AttributeError:
|
||||
LOG.warning('RBAC: Invalid user')
|
||||
LOG.warning(_('RBAC: Invalid user'))
|
||||
raise exception.Unauthorized()
|
||||
|
||||
try:
|
||||
creds['tenant_id'] = token_ref['tenant'].get('id')
|
||||
except AttributeError:
|
||||
LOG.debug('RBAC: Proceeding without tenant')
|
||||
LOG.debug(_('RBAC: Proceeding without tenant'))
|
||||
|
||||
# NOTE(vish): this is pretty inefficient
|
||||
creds['roles'] = [self.identity_api.get_role(context, role)['name']
|
||||
@ -48,9 +48,9 @@ def protected(f):
|
||||
|
||||
self.policy_api.enforce(context, creds, action, kwargs)
|
||||
|
||||
LOG.debug('RBAC: Authorization granted')
|
||||
LOG.debug(_('RBAC: Authorization granted'))
|
||||
else:
|
||||
LOG.warning('RBAC: Bypassing authorization')
|
||||
LOG.warning(_('RBAC: Bypassing authorization'))
|
||||
|
||||
return f(self, context, **kwargs)
|
||||
return wrapper
|
||||
|
@ -336,11 +336,11 @@ class BaseLdap(object):
|
||||
|
||||
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):
|
||||
@ -351,15 +351,15 @@ class LdapWrapper(object):
|
||||
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 = []
|
||||
@ -379,14 +379,14 @@ class LdapWrapper(object):
|
||||
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)
|
||||
|
@ -44,7 +44,7 @@ def db_sync(version=None):
|
||||
try:
|
||||
version = int(version)
|
||||
except ValueError:
|
||||
raise Exception('version should be an integer')
|
||||
raise Exception(_('version should be an integer'))
|
||||
|
||||
current_version = db_version()
|
||||
repo_path = _find_migrate_repo()
|
||||
|
@ -90,8 +90,8 @@ class Ec2Signer(object):
|
||||
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):
|
||||
|
@ -705,7 +705,7 @@ class RoleApi(common_ldap.BaseLdap, ApiShimMixin):
|
||||
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])]
|
||||
|
Loading…
Reference in New Issue
Block a user