Fixes i18n message for ryu plugin

Fixes bug 1095975

Change-Id: I72bbeeb80117f4d5fcf6af9910dc881fd1b1a82e
This commit is contained in:
He Jie Xu 2013-01-04 17:13:27 +08:00
parent f77ed34d09
commit 3bce16abee
4 changed files with 18 additions and 18 deletions

View File

@ -142,7 +142,7 @@ class VifPortSet(object):
def setup(self): def setup(self):
for port in self.int_br.get_external_ports(): 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, self.api.update_port(rest_nw_id.NW_ID_EXTERNAL,
port.switch.datapath_id, port.ofport) port.switch.datapath_id, port.ofport)
@ -180,7 +180,7 @@ class OVSQuantumOFPRyuAgent(object):
def check_ofp_rest_api_addr(db): def check_ofp_rest_api_addr(db):
LOG.debug("checking db") LOG.debug(_("Checking db"))
servers = db.ofp_server.all() servers = db.ofp_server.all()
@ -192,15 +192,15 @@ def check_ofp_rest_api_addr(db):
elif serv.host_type == "controller": elif serv.host_type == "controller":
ofp_controller_addr = serv.address ofp_controller_addr = serv.address
else: 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: if ofp_controller_addr:
LOG.warn(_('OF controller parameter is stale %s'), ofp_controller_addr) LOG.warn(_('OF controller parameter is stale %s'), ofp_controller_addr)
if not ofp_rest_api_addr: if not ofp_rest_api_addr:
raise RuntimeError(_("Ryu rest API port isn't specified")) 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 return ofp_rest_api_addr
@ -215,7 +215,7 @@ def main():
options = {"sql_connection": cfg.CONF.DATABASE.sql_connection} options = {"sql_connection": cfg.CONF.DATABASE.sql_connection}
db = SqlSoup(options["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, {"database": db.engine.url.database,
"host": db.engine.url.host}) "host": db.engine.url.host})
ofp_rest_api_addr = check_ofp_rest_api_addr(db) ofp_rest_api_addr = check_ofp_rest_api_addr(db)
@ -230,7 +230,7 @@ def main():
OVSQuantumOFPRyuAgent(integ_br, ofp_rest_api_addr, OVSQuantumOFPRyuAgent(integ_br, ofp_rest_api_addr,
tunnel_ip, ovsdb_ip, ovsdb_port, root_helper) tunnel_ip, ovsdb_ip, ovsdb_port, root_helper)
except httplib.HTTPException, e: except httplib.HTTPException, e:
LOG.error(_("initialization failed: %s"), e) LOG.error(_("Initialization failed: %s"), e)
sys.exit(1) sys.exit(1)
LOG.info(_("Ryu initialization on the node is done." LOG.info(_("Ryu initialization on the node is done."

View File

@ -23,19 +23,19 @@ database_opts = [
cfg.IntOpt('reconnect_interval', default=2), cfg.IntOpt('reconnect_interval', default=2),
cfg.IntOpt('sql_min_pool_size', cfg.IntOpt('sql_min_pool_size',
default=1, default=1,
help="Minimum number of SQL connections to keep open in a " help=_("Minimum number of SQL connections to keep open in a "
"pool"), "pool")),
cfg.IntOpt('sql_max_pool_size', cfg.IntOpt('sql_max_pool_size',
default=5, default=5,
help="Maximum number of SQL connections to keep open in a " help=_("Maximum number of SQL connections to keep open in a "
"pool"), "pool")),
cfg.IntOpt('sql_idle_timeout', cfg.IntOpt('sql_idle_timeout',
default=3600, default=3600,
help="Timeout in seconds before idle sql connections are " help=_("Timeout in seconds before idle sql connections are "
"reaped"), "reaped")),
cfg.BoolOpt('sql_dbpool_enable', cfg.BoolOpt('sql_dbpool_enable',
default=False, 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 = [ ovs_opts = [

View File

@ -135,10 +135,10 @@ class TunnelKey(object):
).params(last_key=last_key).one() ).params(last_key=last_key).one()
new_key = new_key[0] # the result is tuple. new_key = new_key[0] # the result is tuple.
LOG.debug(_("last_key %(last_key)s new_key %(new_key)s") % LOG.debug(_("last_key %(last_key)s new_key %(new_key)s"),
{"last_key": last_key, "new_key": new_key}) locals())
if new_key > self.key_max: if new_key > self.key_max:
LOG.debug(_("no key found")) LOG.debug(_("No key found"))
raise orm_exc.NoResultFound() raise orm_exc.NoResultFound()
return new_key return new_key

View File

@ -73,7 +73,7 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
ofp_api_host = cfg.CONF.OVS.openflow_rest_api ofp_api_host = cfg.CONF.OVS.openflow_rest_api
if ofp_con_host is None or ofp_api_host is None: 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), hosts = [(ofp_con_host, ofp_service_type.CONTROLLER),
(ofp_api_host, ofp_service_type.REST_API)] (ofp_api_host, ofp_service_type.REST_API)]