diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-01-04 22:29:31 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-01-04 22:29:31 +0000 |
| commit | 2b08994e1f9d4ea7d7659faa014f541ed9a82e0e (patch) | |
| tree | 408c38ab065d44469b88188f75931a9b5508ef01 | |
| parent | 863acc7b6d39de3596e2bf767397774053156f45 (diff) | |
| parent | 0e5533eb6f828cffac1cdd98a524f69503332cec (diff) | |
| download | keystone-2b08994e1f9d4ea7d7659faa014f541ed9a82e0e.tar.gz keystone-2b08994e1f9d4ea7d7659faa014f541ed9a82e0e.tar.xz keystone-2b08994e1f9d4ea7d7659faa014f541ed9a82e0e.zip | |
Merge "il8n some strings"
| -rw-r--r-- | keystone/common/controller.py | 14 | ||||
| -rw-r--r-- | keystone/common/ldap/core.py | 16 | ||||
| -rw-r--r-- | keystone/common/sql/migration.py | 2 | ||||
| -rw-r--r-- | keystone/common/utils.py | 4 | ||||
| -rw-r--r-- | 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 ee7ce5b5..58164338 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 a9e34f5b..e1a9f053 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 0b0ffeaa..86e0254c 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 fadfa893..1a43f872 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 709c8ecb..5b083cd9 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])] |
