]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fixes i18n message for ryu plugin
authorHe Jie Xu <xuhj@linux.vnet.ibm.com>
Fri, 4 Jan 2013 09:13:27 +0000 (17:13 +0800)
committerHe Jie Xu <xuhj@linux.vnet.ibm.com>
Fri, 4 Jan 2013 09:14:01 +0000 (17:14 +0800)
Fixes bug 1095975

Change-Id: I72bbeeb80117f4d5fcf6af9910dc881fd1b1a82e

quantum/plugins/ryu/agent/ryu_quantum_agent.py
quantum/plugins/ryu/common/config.py
quantum/plugins/ryu/db/api_v2.py
quantum/plugins/ryu/ryu_quantum_plugin.py

index b19e9dbe71ac3598f62867f80824d935f4485e73..5fd9bea2dbd787ad65a0651e7408b201a5e67827 100755 (executable)
@@ -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."
index 1ef53d2de07153dbe984de01253c7256b037eee4..a54ffb73a4d0aedfedd11074ad166585d7cac693 100644 (file)
@@ -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 = [
index ca7fd1a037cd9f1ed74fe2fadf76aec992214aa7..afffd8c7397dfb61614016cb3f9378db2dd6b38f 100644 (file)
@@ -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
 
index 1a11957ab6571ba7b7fdb7eafe1b9a7063f7fc88..ec9e98b8dc96f5411386c17eb1712e30eee50cd8 100644 (file)
@@ -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)]