Merge "Implement primary support for i18n messages shown to user"

This commit is contained in:
Jenkins 2013-12-20 10:18:25 +00:00 committed by Gerrit Code Review
commit d70eb25e02
12 changed files with 969 additions and 27 deletions

1
babel.cfg Normal file
View File

@ -0,0 +1 @@
[python: **.py]

View File

@ -22,6 +22,7 @@ from werkzeug import exceptions as werkzeug_exceptions
from climate.api.oshosts import v1_0 as host_api_v1_0
from climate.api import utils as api_utils
from climate.api import v1_0 as api_v1_0
from climate.openstack.common.gettextutils import _ # noqa
from climate.openstack.common import log
from climate.openstack.common.middleware import debug
@ -82,8 +83,8 @@ def make_app():
app.error_handler_spec[None][code] = make_json_error
if cfg.CONF.debug and not cfg.CONF.log_exchange:
LOG.debug('Logging of request/response exchange could be enabled using'
' flag --log-exchange')
LOG.debug(_('Logging of request/response exchange could be enabled '
'using flag --log-exchange'))
if cfg.CONF.log_exchange:
app.wsgi_app = debug.Debug.factory(app.config)(app.wsgi_app)

View File

@ -21,6 +21,7 @@ from werkzeug import datastructures
from climate.api import context
from climate import exceptions as ex
from climate.openstack.common.deprecated import wsgi
from climate.openstack.common.gettextutils import _ # noqa
from climate.openstack.common import log as logging
LOG = logging.getLogger(__name__)
@ -56,7 +57,7 @@ class Rest(flask.Blueprint):
endpoint = options.pop('endpoint', func.__name__)
def handler(**kwargs):
LOG.debug("Rest.route.decorator.handler, kwargs=%s", kwargs)
LOG.debug(_("Rest.route.decorator.handler, kwargs=%s"), kwargs)
_init_resp_type(file_upload)
@ -110,7 +111,8 @@ def render(result=None, response_type=None, status=None, **kwargs):
result.update(kwargs)
elif kwargs:
# can't merge kwargs into the non-dict res
abort_and_log(500, "Non-dict and non-empty kwargs passed to render.")
abort_and_log(500,
_("Non-dict and non-empty kwargs passed to render."))
return
status_code = getattr(flask.request, 'status_code', None)
@ -127,7 +129,8 @@ def render(result=None, response_type=None, status=None, **kwargs):
response_type = RT_JSON
serializer = wsgi.JSONDictSerializer()
else:
abort_and_log(400, "Content type '%s' isn't supported" % response_type)
abort_and_log(400,
_("Content type '%s' isn't supported") % response_type)
return
body = serializer.serialize(result)
@ -144,7 +147,7 @@ def request_data():
return flask.request.parsed_data
if not flask.request.content_length > 0:
LOG.debug("Empty body provided in request")
LOG.debug(_("Empty body provided in request"))
return dict()
if flask.request.file_upload:
@ -155,7 +158,8 @@ def request_data():
if not content_type or content_type in RT_JSON:
deserializer = wsgi.JSONDeserializer()
else:
abort_and_log(400, "Content type '%s' isn't supported" % content_type)
abort_and_log(400,
_("Content type '%s' isn't supported") % content_type)
return
# parsed request data to avoid unwanted re-parsings
@ -171,8 +175,8 @@ def get_request_args():
def abort_and_log(status_code, descr, exc=None):
"""Process occurred errors."""
LOG.error("Request aborted with status code %s and message '%s'",
status_code, descr)
LOG.error(_("Request aborted with status code %(code)s and "
"message '%(msg)s'"), {'code': status_code, 'msg': descr})
if exc is not None:
LOG.error(traceback.format_exc())
@ -196,8 +200,8 @@ def render_error_message(error_code, error_message, error_name):
def internal_error(status_code, descr, exc=None):
"""Called if internal error occurred."""
LOG.error("Request aborted with status code %s and message '%s'",
status_code, descr)
LOG.error(_("Request aborted with status code %(code)s "
"and message '%(msg)s'"), {'code': status_code, 'msg': descr})
if exc is not None:
LOG.error(traceback.format_exc())
@ -214,9 +218,9 @@ def bad_request(error):
if not error.code:
error.code = 400
LOG.debug("Validation Error occurred: "
"error_code=%s, error_message=%s, error_name=%s",
error.code, error.message, error.code)
LOG.debug(_("Validation Error occurred: error_code=%(code)s, "
"error_message=%(msg)s, error_name=%(name)s"),
{'code': error.code, 'msg': error.message, 'name': error.code})
return render_error_message(error.code, error.message, error.code)
@ -226,8 +230,8 @@ def not_found(error):
if not error.code:
error.code = 404
LOG.debug("Not Found exception occurred: "
"error_code=%s, error_message=%s, error_name=%s",
error.code, error.message, error.code)
LOG.debug(_("Not Found exception occurred: error_code=%(code)s, "
"error_message=%(msg)s, error_name=%(name)s"),
{'code': error.code, 'msg': error.message, 'name': error.code})
return render_error_message(error.code, error.message, error.code)

View File

@ -21,7 +21,6 @@ import eventlet
from eventlet import wsgi
from oslo.config import cfg
gettext.install('climate', unicode=1)
from climate.api import app as api_app

View File

@ -13,17 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import eventlet
eventlet.monkey_patch()
import gettext
import sys
import eventlet
eventlet.monkey_patch()
from oslo.config import cfg
gettext.install('climate', unicode=1)
from climate.db import api as db_api
from climate.manager import service as manager_service
from climate.openstack.common import service
from climate.utils import service as service_utils
cfg.CONF.import_opt('host', 'climate.config')

View File

@ -13,10 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import gettext
from oslo.config import cfg
from climate.db import api as db_api
gettext.install('climate', unicode=1)
from climate.db import api as db_api
from climate.openstack.common.gettextutils import _ # noqa
CONF = cfg.CONF
@ -27,9 +31,9 @@ def map_status(status):
def db_sync():
drop_status = db_api.drop_db()
print("Dropping database: %s" % map_status(drop_status))
print(_("Dropping database: %s") % map_status(drop_status))
start_status = db_api.setup_db()
print("Creating database: %s" % map_status(start_status))
print(_("Creating database: %s") % map_status(start_status))
def add_command_parsers(subparsers):

View File

@ -25,6 +25,7 @@ from climate import context
from climate.db.sqlalchemy import models
from climate.openstack.common.db import exception as db_exc
from climate.openstack.common.db.sqlalchemy import session as db_session
from climate.openstack.common.gettextutils import _ # noqa
from climate.openstack.common import log as logging
@ -74,7 +75,7 @@ def setup_db():
engine = db_session.get_engine(sqlite_fk=True)
models.Lease.metadata.create_all(engine)
except sa.exc.OperationalError as e:
LOG.error("Database registration exception: %s", e)
LOG.error(_("Database registration exception: %s"), e)
return False
return True
@ -84,7 +85,7 @@ def drop_db():
engine = db_session.get_engine(sqlite_fk=True)
models.Lease.metadata.drop_all(engine)
except Exception as e:
LOG.error("Database shutdown exception: %s", e)
LOG.error(_("Database shutdown exception: %s"), e)
return False
return True

2
climate/locale/README Normal file
View File

@ -0,0 +1,2 @@
Climate translations
====================

919
climate/locale/climate.pot Normal file
View File

@ -0,0 +1,919 @@
# Translations template for climate.
# Copyright (C) 2013 ORGANIZATION
# This file is distributed under the same license as the climate project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: climate 2013.1.dev66.g1635e31\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2013-12-05 18:35+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
#: climate/exceptions.py:30
msgid "An unknown exception occurred"
msgstr ""
#: climate/exceptions.py:45 climate/openstack/common/rpc/common.py:90
msgid "Exception in string format operation"
msgstr ""
#: climate/exceptions.py:56
#, python-format
msgid "Object with %(object)s not found"
msgstr ""
#: climate/exceptions.py:61
msgid "Not authorized"
msgstr ""
#: climate/exceptions.py:66
#, python-format
msgid "Policy doesn't allow %(action)s to be performed"
msgstr ""
#: climate/exceptions.py:70
#, python-format
msgid "Could not find config at %(path)s"
msgstr ""
#: climate/api/app.py:86
msgid ""
"Logging of request/response exchange could be enabled using flag --log-"
"exchange"
msgstr ""
#: climate/api/utils.py:60
#, python-format
msgid "Rest.route.decorator.handler, kwargs=%s"
msgstr ""
#: climate/api/utils.py:115
msgid "Non-dict and non-empty kwargs passed to render."
msgstr ""
#: climate/api/utils.py:133 climate/api/utils.py:162
#, python-format
msgid "Content type '%s' isn't supported"
msgstr ""
#: climate/api/utils.py:150 climate/openstack/common/deprecated/wsgi.py:598
msgid "Empty body provided in request"
msgstr ""
#: climate/api/utils.py:178 climate/api/utils.py:203
#, python-format
msgid "Request aborted with status code %(code)s and message '%(msg)s'"
msgstr ""
#: climate/api/utils.py:221
#, python-format
msgid ""
"Validation Error occurred: error_code=%(code)s, error_message=%(msg)s, "
"error_name=%(name)s"
msgstr ""
#: climate/api/utils.py:233
#, python-format
msgid ""
"Not Found exception occurred: error_code=%(code)s, error_message=%(msg)s,"
" error_name=%(name)s"
msgstr ""
#: climate/db/migration/cli.py:34
#, python-format
msgid "Dropping database: %s"
msgstr ""
#: climate/db/migration/cli.py:36
#, python-format
msgid "Creating database: %s"
msgstr ""
#: climate/db/sqlalchemy/api.py:78
#, python-format
msgid "Database registration exception: %s"
msgstr ""
#: climate/db/sqlalchemy/api.py:88
#, python-format
msgid "Database shutdown exception: %s"
msgstr ""
#: climate/manager/service.py:117
msgid "Trying to get event from DB."
msgstr ""
#: climate/manager/service.py:141
msgid "Error occurred while event handling."
msgstr ""
#: climate/openstack/common/eventlet_backdoor.py:142
#, python-format
msgid "Eventlet backdoor listening on %(port)s for process %(pid)d"
msgstr ""
#: climate/openstack/common/excutils.py:64
#, python-format
msgid "Original exception being dropped: %s"
msgstr ""
#: climate/openstack/common/excutils.py:93
#, python-format
msgid "Unexpected exception occurred %d time(s)... retrying."
msgstr ""
#: climate/openstack/common/fileutils.py:65
#, python-format
msgid "Reloading cached file %s"
msgstr ""
#: climate/openstack/common/lockutils.py:105
#, python-format
msgid "Could not release the acquired lock `%s`"
msgstr ""
#: climate/openstack/common/lockutils.py:170
#, python-format
msgid "Got semaphore \"%(lock)s\""
msgstr ""
#: climate/openstack/common/lockutils.py:179
#, python-format
msgid "Attempting to grab file lock \"%(lock)s\""
msgstr ""
#: climate/openstack/common/lockutils.py:189
#, python-format
msgid "Created lock path: %s"
msgstr ""
#: climate/openstack/common/lockutils.py:207
#, python-format
msgid "Got file lock \"%(lock)s\" at %(path)s"
msgstr ""
#: climate/openstack/common/lockutils.py:211
#, python-format
msgid "Released file lock \"%(lock)s\" at %(path)s"
msgstr ""
#: climate/openstack/common/lockutils.py:249
#, python-format
msgid "Got semaphore / lock \"%(function)s\""
msgstr ""
#: climate/openstack/common/lockutils.py:253
#, python-format
msgid "Semaphore / lock released \"%(function)s\""
msgstr ""
#: climate/openstack/common/log.py:245
#, python-format
msgid "Deprecated: %s"
msgstr ""
#: climate/openstack/common/log.py:344
#, python-format
msgid "Error loading logging config %(log_config)s: %(err_msg)s"
msgstr ""
#: climate/openstack/common/log.py:394
#, python-format
msgid "syslog facility must be one of: %s"
msgstr ""
#: climate/openstack/common/log.py:564
#, python-format
msgid "Fatal call to deprecated config: %(msg)s"
msgstr ""
#: climate/openstack/common/loopingcall.py:84
#, python-format
msgid "task run outlasted interval by %s sec"
msgstr ""
#: climate/openstack/common/loopingcall.py:91
msgid "in fixed duration looping call"
msgstr ""
#: climate/openstack/common/loopingcall.py:131
#, python-format
msgid "Dynamic looping call sleeping for %.02f seconds"
msgstr ""
#: climate/openstack/common/loopingcall.py:138
msgid "in dynamic looping call"
msgstr ""
#: climate/openstack/common/policy.py:75
msgid "JSON file containing policy"
msgstr ""
#: climate/openstack/common/policy.py:78
msgid "Rule enforced when requested rule is not found"
msgstr ""
#: climate/openstack/common/policy.py:92
#, python-format
msgid "Policy doesn't allow %s to be performed."
msgstr ""
#: climate/openstack/common/policy.py:177
#, python-format
msgid "Rules must be an instance of dict or Rules, got %s instead"
msgstr ""
#: climate/openstack/common/policy.py:207
msgid "Rules successfully reloaded"
msgstr ""
#: climate/openstack/common/policy.py:253
#, python-format
msgid "Rule %s will be now enforced"
msgstr ""
#: climate/openstack/common/policy.py:268
#, python-format
msgid "Rule [%s] doesn't exist"
msgstr ""
#: climate/openstack/common/policy.py:477
#, python-format
msgid "Failed to understand rule %s"
msgstr ""
#: climate/openstack/common/policy.py:487
#, python-format
msgid "No handler for matches of kind %s"
msgstr ""
#: climate/openstack/common/policy.py:758
#, python-format
msgid "Failed to understand rule %r"
msgstr ""
#: climate/openstack/common/service.py:136
#: climate/openstack/common/service.py:346
msgid "Full set of CONF:"
msgstr ""
#: climate/openstack/common/service.py:143
#: climate/openstack/common/service.py:231
#, python-format
msgid "Caught %s, exiting"
msgstr ""
#: climate/openstack/common/service.py:155
msgid "Exception during rpc cleanup."
msgstr ""
#: climate/openstack/common/service.py:200
msgid "Parent process has died unexpectedly, exiting"
msgstr ""
#: climate/openstack/common/service.py:237
msgid "Unhandled exception"
msgstr ""
#: climate/openstack/common/service.py:270
msgid "Forking too fast, sleeping"
msgstr ""
#: climate/openstack/common/service.py:289
#, python-format
msgid "Started child %d"
msgstr ""
#: climate/openstack/common/service.py:299
#, python-format
msgid "Starting %d workers"
msgstr ""
#: climate/openstack/common/service.py:316
#, python-format
msgid "Child %(pid)d killed by signal %(sig)d"
msgstr ""
#: climate/openstack/common/service.py:320
#, python-format
msgid "Child %(pid)s exited with status %(code)d"
msgstr ""
#: climate/openstack/common/service.py:324
#, python-format
msgid "pid %d not in child list"
msgstr ""
#: climate/openstack/common/service.py:354
#, python-format
msgid "Caught %s, stopping children"
msgstr ""
#: climate/openstack/common/service.py:372
#, python-format
msgid "Waiting on %d children to exit"
msgstr ""
#: climate/openstack/common/sslutils.py:52
#, python-format
msgid "Unable to find cert_file : %s"
msgstr ""
#: climate/openstack/common/sslutils.py:55
#, python-format
msgid "Unable to find ca_file : %s"
msgstr ""
#: climate/openstack/common/sslutils.py:58
#, python-format
msgid "Unable to find key_file : %s"
msgstr ""
#: climate/openstack/common/sslutils.py:61
msgid ""
"When running server in SSL mode, you must specify both a cert_file and "
"key_file option value in your configuration file"
msgstr ""
#: climate/openstack/common/sslutils.py:100
#, python-format
msgid "Invalid SSL version : %s"
msgstr ""
#: climate/openstack/common/crypto/utils.py:29
msgid "An unknown error occurred in crypto utils."
msgstr ""
#: climate/openstack/common/crypto/utils.py:36
#, python-format
msgid "Block size of %(given)d is too big, max = %(maximum)d"
msgstr ""
#: climate/openstack/common/crypto/utils.py:45
#, python-format
msgid "Length of %(given)d is too long, max = %(maximum)d"
msgstr ""
#: climate/openstack/common/db/exception.py:44
msgid "Invalid Parameter: Unicode is not supported by the current database."
msgstr ""
#: climate/openstack/common/db/sqlalchemy/migration.py:219
msgid "version should be an integer"
msgstr ""
#: climate/openstack/common/db/sqlalchemy/migration.py:251
msgid "Upgrade DB using Essex release first."
msgstr ""
#: climate/openstack/common/db/sqlalchemy/session.py:553
msgid "DB exception wrapped."
msgstr ""
#: climate/openstack/common/db/sqlalchemy/session.py:616
#, python-format
msgid "Got mysql server has gone away: %s"
msgstr ""
#: climate/openstack/common/db/sqlalchemy/session.py:696
#, python-format
msgid "SQL connection failed. %s attempts left."
msgstr ""
#: climate/openstack/common/db/sqlalchemy/utils.py:60
msgid "Sort key supplied was not valid."
msgstr ""
#: climate/openstack/common/db/sqlalchemy/utils.py:99
msgid "Id not in sort_keys; is sort_keys unique?"
msgstr ""
#: climate/openstack/common/db/sqlalchemy/utils.py:121
msgid "Unknown sort direction, must be 'desc' or 'asc'"
msgstr ""
#: climate/openstack/common/db/sqlalchemy/utils.py:196
#, python-format
msgid ""
"Please specify column %s in col_name_col_instance param. It is required "
"because column has unsupported type by sqlite)."
msgstr ""
#: climate/openstack/common/db/sqlalchemy/utils.py:202
#, python-format
msgid ""
"col_name_col_instance param has wrong type of column instance for column "
"%s It should be instance of sqlalchemy.Column."
msgstr ""
#: climate/openstack/common/db/sqlalchemy/utils.py:282
#, python-format
msgid "Deleting duplicated row with id: %(id)s from table: %(table)s"
msgstr ""
#: climate/openstack/common/db/sqlalchemy/utils.py:303
msgid "Unsupported id columns type"
msgstr ""
#: climate/openstack/common/deprecated/wsgi.py:121
#, python-format
msgid "Could not bind to %(host)s:%(port)s after trying for 30 seconds"
msgstr ""
#: climate/openstack/common/deprecated/wsgi.py:309
msgid "Unsupported Content-Type"
msgstr ""
#: climate/openstack/common/deprecated/wsgi.py:312
msgid "Malformed request body"
msgstr ""
#: climate/openstack/common/deprecated/wsgi.py:604
msgid "Unrecognized Content-Type provided in request"
msgstr ""
#: climate/openstack/common/deprecated/wsgi.py:608
msgid "No Content-Type provided in request"
msgstr ""
#: climate/openstack/common/deprecated/wsgi.py:614
msgid "Unable to deserialize body as provided Content-Type"
msgstr ""
#: climate/openstack/common/deprecated/wsgi.py:664
msgid "cannot understand JSON"
msgstr ""
#: climate/openstack/common/deprecated/wsgi.py:689
msgid "cannot understand XML"
msgstr ""
#: climate/openstack/common/middleware/notifier.py:40
#, python-format
msgid "An exception occurred processing the API call: %s "
msgstr ""
#: climate/openstack/common/middleware/sizelimit.py:57
#: climate/openstack/common/middleware/sizelimit.py:66
#: climate/openstack/common/middleware/sizelimit.py:77
msgid "Request is too large."
msgstr ""
#: climate/openstack/common/notifier/api.py:129
#, python-format
msgid "%s not in valid priorities"
msgstr ""
#: climate/openstack/common/notifier/api.py:145
#, python-format
msgid ""
"Problem '%(e)s' attempting to send to notification system. "
"Payload=%(payload)s"
msgstr ""
#: climate/openstack/common/notifier/api.py:164
#, python-format
msgid "Failed to load notifier %s. These notifications will not be sent."
msgstr ""
#: climate/openstack/common/notifier/rpc_notifier.py:45
#: climate/openstack/common/notifier/rpc_notifier2.py:51
#, python-format
msgid "Could not send notification to %(topic)s. Payload=%(message)s"
msgstr ""
#: climate/openstack/common/rpc/__init__.py:105
#, python-format
msgid ""
"A RPC is being made while holding a lock. The locks currently held are "
"%(locks)s. This is probably a bug. Please report it. Include the "
"following: [%(stack)s]."
msgstr ""
#: climate/openstack/common/rpc/amqp.py:75
msgid "Pool creating new connection"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:202
#, python-format
msgid "No calling threads waiting for msg_id : %(msg_id)s, message : %(data)s"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:205
#, python-format
msgid "_call_waiters: %s"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:212
#, python-format
msgid ""
"Number of call waiters is greater than warning threshhold: %d. There "
"could be a MulticallProxyWaiter leak."
msgstr ""
#: climate/openstack/common/rpc/amqp.py:290
#, python-format
msgid "unpacked context: %s"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:341
#, python-format
msgid "UNIQUE_ID is %s."
msgstr ""
#: climate/openstack/common/rpc/amqp.py:434
#, python-format
msgid "received %s"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:442
#, python-format
msgid "no method for message: %s"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:443
#, python-format
msgid "No method for message: %s"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:471
#: climate/openstack/common/rpc/impl_zmq.py:280
#, python-format
msgid "Expected exception during message handling (%s)"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:479
#: climate/openstack/common/rpc/impl_zmq.py:286
msgid "Exception during message handling"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:553
#, python-format
msgid "Making synchronous call on %s ..."
msgstr ""
#: climate/openstack/common/rpc/amqp.py:556
#, python-format
msgid "MSG_ID is %s"
msgstr ""
#: climate/openstack/common/rpc/amqp.py:582
#, python-format
msgid "Making asynchronous cast on %s..."
msgstr ""
#: climate/openstack/common/rpc/amqp.py:591
msgid "Making asynchronous fanout cast..."
msgstr ""
#: climate/openstack/common/rpc/amqp.py:619
#, python-format
msgid "Sending %(event_type)s on %(topic)s"
msgstr ""
#: climate/openstack/common/rpc/common.py:78
msgid "An unknown RPC related exception occurred."
msgstr ""
#: climate/openstack/common/rpc/common.py:108
#, python-format
msgid ""
"Remote error: %(exc_type)s %(value)s\n"
"%(traceback)s."
msgstr ""
#: climate/openstack/common/rpc/common.py:125
#, python-format
msgid ""
"Timeout while waiting on RPC response - topic: \"%(topic)s\", RPC method:"
" \"%(method)s\" info: \"%(info)s\""
msgstr ""
#: climate/openstack/common/rpc/common.py:142
#: climate/openstack/common/rpc/common.py:143
#: climate/openstack/common/rpc/common.py:144
msgid "<unknown>"
msgstr ""
#: climate/openstack/common/rpc/common.py:148
#, python-format
msgid "Found duplicate message(%(msg_id)s). Skipping it."
msgstr ""
#: climate/openstack/common/rpc/common.py:152
msgid "Invalid reuse of an RPC connection."
msgstr ""
#: climate/openstack/common/rpc/common.py:156
#, python-format
msgid "Specified RPC version, %(version)s, not supported by this endpoint."
msgstr ""
#: climate/openstack/common/rpc/common.py:161
#, python-format
msgid ""
"Specified RPC envelope version, %(version)s, not supported by this "
"endpoint."
msgstr ""
#: climate/openstack/common/rpc/common.py:166
#, python-format
msgid "Specified RPC version cap, %(version_cap)s, is too low"
msgstr ""
#: climate/openstack/common/rpc/common.py:290
#, python-format
msgid "Returning exception %s to caller"
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:157
msgid "Failed to process message ... skipping it."
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:161
msgid "Failed to process message ... will requeue."
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:496
#, python-format
msgid "Reconnecting to AMQP server on %(hostname)s:%(port)d"
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:518
#, python-format
msgid "Connected to AMQP server on %(hostname)s:%(port)d"
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:555
#, python-format
msgid ""
"Unable to connect to AMQP server on %(hostname)s:%(port)d after "
"%(max_retries)d tries: %(err_str)s"
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:569
#, python-format
msgid ""
"AMQP server on %(hostname)s:%(port)d is unreachable: %(err_str)s. Trying "
"again in %(sleep_time)d seconds."
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:623
#: climate/openstack/common/rpc/impl_qpid.py:585
#, python-format
msgid "Failed to declare consumer for topic '%(topic)s': %(err_str)s"
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:641
#: climate/openstack/common/rpc/impl_qpid.py:600
#, python-format
msgid "Timed out waiting for RPC response: %s"
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:645
#: climate/openstack/common/rpc/impl_qpid.py:604
#, python-format
msgid "Failed to consume message from queue: %s"
msgstr ""
#: climate/openstack/common/rpc/impl_kombu.py:684
#: climate/openstack/common/rpc/impl_qpid.py:639
#, python-format
msgid "Failed to publish message to topic '%(topic)s': %(err_str)s"
msgstr ""
#: climate/openstack/common/rpc/impl_qpid.py:89
#, python-format
msgid "Invalid value for qpid_topology_version: %d"
msgstr ""
#: climate/openstack/common/rpc/impl_qpid.py:191
msgid "Failed to process message... skipping it."
msgstr ""
#: climate/openstack/common/rpc/impl_qpid.py:527
#, python-format
msgid "Unable to connect to AMQP server: %(e)s. Sleeping %(delay)s seconds"
msgstr ""
#: climate/openstack/common/rpc/impl_qpid.py:533
#, python-format
msgid "Connected to AMQP server on %s"
msgstr ""
#: climate/openstack/common/rpc/impl_qpid.py:546
msgid "Re-established AMQP queues"
msgstr ""
#: climate/openstack/common/rpc/impl_qpid.py:612
msgid "Error processing message. Skipping it."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:96
msgid "JSON serialization failed."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:101
#, python-format
msgid "Deserializing: %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:136
#, python-format
msgid "Connecting to %(addr)s with %(type)s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:137
#, python-format
msgid "-> Subscribed to %(subscribe)s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:138
#, python-format
msgid "-> bind: %(bind)s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:146
msgid "Could not open socket."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:158
#, python-format
msgid "Subscribing to %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:200
msgid "You cannot recv on this socket."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:205
msgid "You cannot send on this socket."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:267
#, python-format
msgid "Running func with context: %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:305
msgid "Sending reply"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:339
msgid "RPC message did not include method."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:371
msgid "Registering reactor"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:383
msgid "In reactor registered"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:388
msgid "Consuming socket"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:438
#, python-format
msgid "Creating proxy for topic: %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:444
msgid "Topic contained dangerous characters."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:476
msgid "Topic socket file creation failed."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:482
#, python-format
msgid "Local per-topic backlog buffer full for topic %(topic)s. Dropping message."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:498
#, python-format
msgid "Required IPC directory does not exist at %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:507
#, python-format
msgid "Permission denied to IPC directory at %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:510
msgid "Could not create ZeroMQ receiver daemon. Socket may already be in use."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:544
#, python-format
msgid "CONSUMER RECEIVED DATA: %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:563
msgid "ZMQ Envelope version unsupported or unknown."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:591
msgid "Skipping topic registration. Already registered."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:598
#, python-format
msgid "Consumer is a zmq.%s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:650
msgid "Creating payload"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:663
msgid "Creating queue socket for reply waiter"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:676
msgid "Sending cast"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:679
msgid "Cast sent; Waiting reply"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:682
#, python-format
msgid "Received message: %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:683
msgid "Unpacking response"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:692
msgid "Unsupported or unknown ZMQ envelope returned."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:699
msgid "RPC Message Invalid."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:722
#, python-format
msgid "%(msg)s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:725
#, python-format
msgid "Sending message(s) to: %s"
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:729
msgid "No matchmaker results. Not casting."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:732
msgid "No match from matchmaker."
msgstr ""
#: climate/openstack/common/rpc/impl_zmq.py:814
#, python-format
msgid "rpc_zmq_matchmaker = %(orig)s is deprecated; use %(new)s instead"
msgstr ""
#: climate/openstack/common/rpc/matchmaker.py:47
msgid "Match not found by MatchMaker."
msgstr ""
#: climate/openstack/common/rpc/matchmaker.py:81
msgid "Matchmaker does not implement registration or heartbeat."
msgstr ""
#: climate/openstack/common/rpc/matchmaker.py:217
#, python-format
msgid "Matchmaker unregistered: %(key)s, %(host)s"
msgstr ""
#: climate/openstack/common/rpc/matchmaker.py:229
msgid "Register before starting heartbeat."
msgstr ""
#: climate/openstack/common/rpc/matchmaker_ring.py:77
#: climate/openstack/common/rpc/matchmaker_ring.py:95
#, python-format
msgid "No key defining hosts for topic '%s', see ringfile"
msgstr ""
#: climate/openstack/common/rpc/service.py:49
#, python-format
msgid "Creating Consumer connection for Service %s"
msgstr ""

View File

@ -22,6 +22,7 @@ from stevedore import enabled
from climate.db import api as db_api
from climate import exceptions
from climate.openstack.common.gettextutils import _ # noqa
from climate.openstack.common import log as logging
from climate.openstack.common.rpc import service as rpc_service
from climate.utils import service as service_utils
@ -113,7 +114,7 @@ class ManagerService(rpc_service.Service):
If there is an event in Climate DB to be done, do it and change its
status to 'DONE'.
"""
LOG.debug('Trying to get event from DB.')
LOG.debug(_('Trying to get event from DB.'))
events = db_api.event_get_all_sorted_by_filters(
sort_key='time',
sort_dir='asc',
@ -137,7 +138,7 @@ class ManagerService(rpc_service.Service):
event['lease_id'], event['id'])
except Exception:
db_api.event_update(event['id'], {'status': 'ERROR'})
LOG.exception('Error occurred while event handling.')
LOG.exception(_('Error occurred while event handling.'))
@service_utils.export_context
def get_lease(self, lease_id):

View File

@ -1,5 +1,6 @@
pbr>=0.5.21,<1.0
Babel>=1.3
eventlet>=0.13.0
Flask>=0.10,<1.0
iso8601>=0.1.8

View File

@ -41,3 +41,8 @@ climate.resource.plugins =
all_files = 1
build-dir = doc/build
source-dir = doc/source
[extract_messages]
keywords = _
mapping_file = babel.cfg
output_file = climate/locale/climate.pot