From 0e5533eb6f828cffac1cdd98a524f69503332cec Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Thu, 3 Jan 2013 08:32:34 -0600 Subject: [PATCH] il8n some strings il8n some more missing strings. Change-Id: I56d1d83093c8a5e895571e2d2db41c7600662754 Signed-off-by: Chuck Short --- keystone/common/controller.py | 14 +++++++------- keystone/common/ldap/core.py | 16 ++++++++-------- keystone/common/sql/migration.py | 2 +- keystone/common/utils.py | 4 ++-- keystone/identity/backends/ldap/core.py | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/keystone/common/controller.py b/keystone/common/controller.py index ee7ce5b509..58164338e3 100644 --- a/keystone/common/controller.py +++ b/keystone/common/controller.py @@ -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 diff --git a/keystone/common/ldap/core.py b/keystone/common/ldap/core.py index a9e34f5bf7..e1a9f0538d 100644 --- a/keystone/common/ldap/core.py +++ b/keystone/common/ldap/core.py @@ -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) diff --git a/keystone/common/sql/migration.py b/keystone/common/sql/migration.py index 0b0ffeaa1e..86e0254cec 100644 --- a/keystone/common/sql/migration.py +++ b/keystone/common/sql/migration.py @@ -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() diff --git a/keystone/common/utils.py b/keystone/common/utils.py index fadfa8936b..1a43f87266 100644 --- a/keystone/common/utils.py +++ b/keystone/common/utils.py @@ -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): diff --git a/keystone/identity/backends/ldap/core.py b/keystone/identity/backends/ldap/core.py index 709c8ecba3..5b083cd9d6 100644 --- a/keystone/identity/backends/ldap/core.py +++ b/keystone/identity/backends/ldap/core.py @@ -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])]