From 82d3452124490391766558c9da9c6c5610a3a35e Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Tue, 27 Aug 2013 08:02:04 +0800 Subject: [PATCH] Fix message i18n error Partial-Bug: #1217100 Using tools/check_i18n.py to scan source directory, and fix most of the errors. - Message internationalization - First letter must be capital - Using comma instead of percent in LOG.xxx Note: all extension's description are not touched in this patch, can be fixed after discussing. Note: all nicira/check_nvp_config.py print messages are not fixed. Change-Id: I79ef06fd42f6780beb5019c592662536c2a51864 --- neutron/services/loadbalancer/agent_scheduler.py | 2 +- neutron/services/loadbalancer/drivers/haproxy/agent_manager.py | 2 +- .../services/loadbalancer/drivers/haproxy/namespace_driver.py | 2 +- neutron/services/loadbalancer/drivers/haproxy/plugin_driver.py | 2 +- tools/i18n_cfg.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/neutron/services/loadbalancer/agent_scheduler.py b/neutron/services/loadbalancer/agent_scheduler.py index 084496e6c..95afe1c18 100644 --- a/neutron/services/loadbalancer/agent_scheduler.py +++ b/neutron/services/loadbalancer/agent_scheduler.py @@ -99,7 +99,7 @@ class ChanceScheduler(object): candidates = plugin.get_lbaas_agents(context, active=True) if not candidates: - LOG.warn(_('No active lbaas agents for pool %s') % pool['id']) + LOG.warn(_('No active lbaas agents for pool %s'), pool['id']) return chosen_agent = random.choice(candidates) diff --git a/neutron/services/loadbalancer/drivers/haproxy/agent_manager.py b/neutron/services/loadbalancer/drivers/haproxy/agent_manager.py index 41da44ae4..6d9cb1be5 100644 --- a/neutron/services/loadbalancer/drivers/haproxy/agent_manager.py +++ b/neutron/services/loadbalancer/drivers/haproxy/agent_manager.py @@ -178,7 +178,7 @@ class LbaasAgentManager(periodic_task.PeriodicTasks): self.agent_state) self.agent_state.pop('start_flag', None) except Exception: - LOG.exception("Failed reporting state!") + LOG.exception(_("Failed reporting state!")) def initialize_service_hook(self, started_by): self.sync_state() diff --git a/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py b/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py index 27ee9e204..20f85c72e 100644 --- a/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py +++ b/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py @@ -117,7 +117,7 @@ class HaproxyNSDriver(object): pool_stats['members'] = self._get_servers_stats(parsed_stats) return pool_stats else: - LOG.warn(_('Stats socket not found for pool %s') % pool_id) + LOG.warn(_('Stats socket not found for pool %s'), pool_id) return {} def _get_backend_stats(self, parsed_stats): diff --git a/neutron/services/loadbalancer/drivers/haproxy/plugin_driver.py b/neutron/services/loadbalancer/drivers/haproxy/plugin_driver.py index 01a5f02a1..cb1c14dc7 100644 --- a/neutron/services/loadbalancer/drivers/haproxy/plugin_driver.py +++ b/neutron/services/loadbalancer/drivers/haproxy/plugin_driver.py @@ -82,7 +82,7 @@ class LoadBalancerCallbacks(object): if not agents: return [] elif len(agents) > 1: - LOG.warning(_('Multiple lbaas agents found on host %s') % host) + LOG.warning(_('Multiple lbaas agents found on host %s'), host) pools = self.plugin.list_pools_on_lbaas_agent(context, agents[0].id) diff --git a/tools/i18n_cfg.py b/tools/i18n_cfg.py index abc1bfb14..5ad1a514d 100644 --- a/tools/i18n_cfg.py +++ b/tools/i18n_cfg.py @@ -94,4 +94,4 @@ msg_format_checkers = [ file_black_list = ["./neutron/tests/unit", "./neutron/openstack", - "./quantum/plugins/bigswitch/tests"] + "./neutron/plugins/bigswitch/tests"]