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']:
|
if not context['is_admin']:
|
||||||
action = 'identity:%s' % f.__name__
|
action = 'identity:%s' % f.__name__
|
||||||
|
|
||||||
LOG.debug('RBAC: Authorizing %s(%s)' % (
|
LOG.debug(_('RBAC: Authorizing %s(%s)' % (
|
||||||
action,
|
action,
|
||||||
', '.join(['%s=%s' % (k, kwargs[k]) for k in kwargs])))
|
', '.join(['%s=%s' % (k, kwargs[k]) for k in kwargs]))))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
token_ref = self.token_api.get_token(
|
token_ref = self.token_api.get_token(
|
||||||
context=context, token_id=context['token_id'])
|
context=context, token_id=context['token_id'])
|
||||||
except exception.TokenNotFound:
|
except exception.TokenNotFound:
|
||||||
LOG.warning('RBAC: Invalid token')
|
LOG.warning(_('RBAC: Invalid token'))
|
||||||
raise exception.Unauthorized()
|
raise exception.Unauthorized()
|
||||||
|
|
||||||
creds = token_ref['metadata'].copy()
|
creds = token_ref['metadata'].copy()
|
||||||
@ -34,13 +34,13 @@ def protected(f):
|
|||||||
try:
|
try:
|
||||||
creds['user_id'] = token_ref['user'].get('id')
|
creds['user_id'] = token_ref['user'].get('id')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
LOG.warning('RBAC: Invalid user')
|
LOG.warning(_('RBAC: Invalid user'))
|
||||||
raise exception.Unauthorized()
|
raise exception.Unauthorized()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
creds['tenant_id'] = token_ref['tenant'].get('id')
|
creds['tenant_id'] = token_ref['tenant'].get('id')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
LOG.debug('RBAC: Proceeding without tenant')
|
LOG.debug(_('RBAC: Proceeding without tenant'))
|
||||||
|
|
||||||
# NOTE(vish): this is pretty inefficient
|
# NOTE(vish): this is pretty inefficient
|
||||||
creds['roles'] = [self.identity_api.get_role(context, role)['name']
|
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)
|
self.policy_api.enforce(context, creds, action, kwargs)
|
||||||
|
|
||||||
LOG.debug('RBAC: Authorization granted')
|
LOG.debug(_('RBAC: Authorization granted'))
|
||||||
else:
|
else:
|
||||||
LOG.warning('RBAC: Bypassing authorization')
|
LOG.warning(_('RBAC: Bypassing authorization'))
|
||||||
|
|
||||||
return f(self, context, **kwargs)
|
return f(self, context, **kwargs)
|
||||||
return wrapper
|
return wrapper
|
||||||
|
@ -336,11 +336,11 @@ class BaseLdap(object):
|
|||||||
|
|
||||||
class LdapWrapper(object):
|
class LdapWrapper(object):
|
||||||
def __init__(self, url):
|
def __init__(self, url):
|
||||||
LOG.debug("LDAP init: url=%s", url)
|
LOG.debug(_("LDAP init: url=%s", url))
|
||||||
self.conn = ldap.initialize(url)
|
self.conn = ldap.initialize(url)
|
||||||
|
|
||||||
def simple_bind_s(self, user, password):
|
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)
|
return self.conn.simple_bind_s(user, password)
|
||||||
|
|
||||||
def add_s(self, dn, attrs):
|
def add_s(self, dn, attrs):
|
||||||
@ -351,15 +351,15 @@ class LdapWrapper(object):
|
|||||||
if kind != 'userPassword'
|
if kind != 'userPassword'
|
||||||
else ['****'])
|
else ['****'])
|
||||||
for kind, values in ldap_attrs]
|
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)
|
return self.conn.add_s(dn, ldap_attrs)
|
||||||
|
|
||||||
def search_s(self, dn, scope, query):
|
def search_s(self, dn, scope, query):
|
||||||
if LOG.isEnabledFor(logging.DEBUG):
|
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,
|
dn,
|
||||||
scope,
|
scope,
|
||||||
query)
|
query))
|
||||||
res = self.conn.search_s(dn, scope, query)
|
res = self.conn.search_s(dn, scope, query)
|
||||||
|
|
||||||
o = []
|
o = []
|
||||||
@ -379,14 +379,14 @@ class LdapWrapper(object):
|
|||||||
sane_modlist = [(op, kind, (values if kind != 'userPassword'
|
sane_modlist = [(op, kind, (values if kind != 'userPassword'
|
||||||
else ['****']))
|
else ['****']))
|
||||||
for op, kind, values in ldap_modlist]
|
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)
|
return self.conn.modify_s(dn, ldap_modlist)
|
||||||
|
|
||||||
def delete_s(self, dn):
|
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)
|
return self.conn.delete_s(dn)
|
||||||
|
|
||||||
def delete_ext_s(self, dn, serverctrls):
|
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)
|
return self.conn.delete_ext_s(dn, serverctrls)
|
||||||
|
@ -44,7 +44,7 @@ def db_sync(version=None):
|
|||||||
try:
|
try:
|
||||||
version = int(version)
|
version = int(version)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise Exception('version should be an integer')
|
raise Exception(_('version should be an integer'))
|
||||||
|
|
||||||
current_version = db_version()
|
current_version = db_version()
|
||||||
repo_path = _find_migrate_repo()
|
repo_path = _find_migrate_repo()
|
||||||
|
@ -90,8 +90,8 @@ class Ec2Signer(object):
|
|||||||
credentials['verb'],
|
credentials['verb'],
|
||||||
credentials['host'],
|
credentials['host'],
|
||||||
credentials['path'])
|
credentials['path'])
|
||||||
raise Exception('Unknown Signature Version: %s' %
|
raise Exception(_('Unknown Signature Version: %s' %
|
||||||
credentials['params']['SignatureVersion'])
|
credentials['params']['SignatureVersion']))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_utf8_value(value):
|
def _get_utf8_value(value):
|
||||||
|
@ -705,7 +705,7 @@ class RoleApi(common_ldap.BaseLdap, ApiShimMixin):
|
|||||||
raise exception.Conflict(type='role grant', details=msg)
|
raise exception.Conflict(type='role grant', details=msg)
|
||||||
except ldap.NO_SUCH_OBJECT:
|
except ldap.NO_SUCH_OBJECT:
|
||||||
if tenant_id is None or self.get(role_id) is None:
|
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]),
|
attrs = [('objectClass', [self.object_class]),
|
||||||
(self.member_attribute, [user_dn])]
|
(self.member_attribute, [user_dn])]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user