From 3bce16abeef451539b2164a0695857f4037a5af8 Mon Sep 17 00:00:00 2001 From: He Jie Xu Date: Fri, 4 Jan 2013 17:13:27 +0800 Subject: [PATCH] Fixes i18n message for ryu plugin Fixes bug 1095975 Change-Id: I72bbeeb80117f4d5fcf6af9910dc881fd1b1a82e --- quantum/plugins/ryu/agent/ryu_quantum_agent.py | 14 +++++++------- quantum/plugins/ryu/common/config.py | 14 +++++++------- quantum/plugins/ryu/db/api_v2.py | 6 +++--- quantum/plugins/ryu/ryu_quantum_plugin.py | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/quantum/plugins/ryu/agent/ryu_quantum_agent.py b/quantum/plugins/ryu/agent/ryu_quantum_agent.py index b19e9dbe7..5fd9bea2d 100755 --- a/quantum/plugins/ryu/agent/ryu_quantum_agent.py +++ b/quantum/plugins/ryu/agent/ryu_quantum_agent.py @@ -142,7 +142,7 @@ class VifPortSet(object): def setup(self): for port in self.int_br.get_external_ports(): - LOG.debug(_('external port %s'), port) + LOG.debug(_('External port %s'), port) self.api.update_port(rest_nw_id.NW_ID_EXTERNAL, port.switch.datapath_id, port.ofport) @@ -180,7 +180,7 @@ class OVSQuantumOFPRyuAgent(object): def check_ofp_rest_api_addr(db): - LOG.debug("checking db") + LOG.debug(_("Checking db")) servers = db.ofp_server.all() @@ -192,15 +192,15 @@ def check_ofp_rest_api_addr(db): elif serv.host_type == "controller": ofp_controller_addr = serv.address else: - LOG.warn(_("ignoring unknown server type %s"), serv) + LOG.warn(_("Ignoring unknown server type %s"), serv) - LOG.debug("api %s", ofp_rest_api_addr) + LOG.debug(_("API %s"), ofp_rest_api_addr) if ofp_controller_addr: LOG.warn(_('OF controller parameter is stale %s'), ofp_controller_addr) if not ofp_rest_api_addr: raise RuntimeError(_("Ryu rest API port isn't specified")) - LOG.debug(_("going to ofp controller mode %s"), ofp_rest_api_addr) + LOG.debug(_("Going to ofp controller mode %s"), ofp_rest_api_addr) return ofp_rest_api_addr @@ -215,7 +215,7 @@ def main(): options = {"sql_connection": cfg.CONF.DATABASE.sql_connection} db = SqlSoup(options["sql_connection"]) - LOG.info(_("Connecting to database \"%(database)s\" on %(host)s") % + LOG.info(_("Connecting to database \"%(database)s\" on %(host)s"), {"database": db.engine.url.database, "host": db.engine.url.host}) ofp_rest_api_addr = check_ofp_rest_api_addr(db) @@ -230,7 +230,7 @@ def main(): OVSQuantumOFPRyuAgent(integ_br, ofp_rest_api_addr, tunnel_ip, ovsdb_ip, ovsdb_port, root_helper) except httplib.HTTPException, e: - LOG.error(_("initialization failed: %s"), e) + LOG.error(_("Initialization failed: %s"), e) sys.exit(1) LOG.info(_("Ryu initialization on the node is done." diff --git a/quantum/plugins/ryu/common/config.py b/quantum/plugins/ryu/common/config.py index 1ef53d2de..a54ffb73a 100644 --- a/quantum/plugins/ryu/common/config.py +++ b/quantum/plugins/ryu/common/config.py @@ -23,19 +23,19 @@ database_opts = [ cfg.IntOpt('reconnect_interval', default=2), cfg.IntOpt('sql_min_pool_size', default=1, - help="Minimum number of SQL connections to keep open in a " - "pool"), + help=_("Minimum number of SQL connections to keep open in a " + "pool")), cfg.IntOpt('sql_max_pool_size', default=5, - help="Maximum number of SQL connections to keep open in a " - "pool"), + help=_("Maximum number of SQL connections to keep open in a " + "pool")), cfg.IntOpt('sql_idle_timeout', default=3600, - help="Timeout in seconds before idle sql connections are " - "reaped"), + help=_("Timeout in seconds before idle sql connections are " + "reaped")), cfg.BoolOpt('sql_dbpool_enable', default=False, - help="Enable the use of eventlet's db_pool for MySQL"), + help=_("Enable the use of eventlet's db_pool for MySQL")), ] ovs_opts = [ diff --git a/quantum/plugins/ryu/db/api_v2.py b/quantum/plugins/ryu/db/api_v2.py index ca7fd1a03..afffd8c73 100644 --- a/quantum/plugins/ryu/db/api_v2.py +++ b/quantum/plugins/ryu/db/api_v2.py @@ -135,10 +135,10 @@ class TunnelKey(object): ).params(last_key=last_key).one() new_key = new_key[0] # the result is tuple. - LOG.debug(_("last_key %(last_key)s new_key %(new_key)s") % - {"last_key": last_key, "new_key": new_key}) + LOG.debug(_("last_key %(last_key)s new_key %(new_key)s"), + locals()) if new_key > self.key_max: - LOG.debug(_("no key found")) + LOG.debug(_("No key found")) raise orm_exc.NoResultFound() return new_key diff --git a/quantum/plugins/ryu/ryu_quantum_plugin.py b/quantum/plugins/ryu/ryu_quantum_plugin.py index 1a11957ab..ec9e98b8d 100644 --- a/quantum/plugins/ryu/ryu_quantum_plugin.py +++ b/quantum/plugins/ryu/ryu_quantum_plugin.py @@ -73,7 +73,7 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, ofp_api_host = cfg.CONF.OVS.openflow_rest_api if ofp_con_host is None or ofp_api_host is None: - raise q_exc.Invalid(_('invalid configuration. check ryu.ini')) + raise q_exc.Invalid(_('Invalid configuration. check ryu.ini')) hosts = [(ofp_con_host, ofp_service_type.CONTROLLER), (ofp_api_host, ofp_service_type.REST_API)] -- 2.45.2