]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Update i18n translation for neutron.cmd log msg's
authorGary Kotton <gkotton@vmware.com>
Mon, 10 Nov 2014 15:07:34 +0000 (07:07 -0800)
committerGary Kotton <gkotton@vmware.com>
Sat, 15 Nov 2014 08:14:42 +0000 (00:14 -0800)
Validate that hacking rules apply to directory neutron/cmd

Change-Id: I7fbeba035e8a7f7602fef96a0e10cec5298b08f3
Partial-bug: #1320867

neutron/cmd/sanity/checks.py
neutron/cmd/sanity_check.py
neutron/hacking/checks.py

index 3fbd6fae0dd4aa340b09baecd9b12f4d342dba0f..ee1b20e38bbf367440f21c54a3d9392acb37a1c4 100644 (file)
@@ -19,6 +19,7 @@ from neutron.agent.linux import ip_link_support
 from neutron.agent.linux import ovs_lib
 from neutron.agent.linux import utils as agent_utils
 from neutron.common import utils
+from neutron.openstack.common.gettextutils import _LE
 from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants as const
 from neutron.plugins.openvswitch.common import constants as ovs_const
@@ -67,11 +68,11 @@ def ofctl_arg_supported(root_helper, cmd, **kwargs):
             agent_utils.execute(full_args, root_helper=root_helper)
         except RuntimeError as e:
             LOG.debug("Exception while checking supported feature via "
-                      "command %s. Exception: %s" % (full_args, e))
+                      "command %s. Exception: %s", (full_args, e))
             return False
         except Exception:
-            LOG.exception(_("Unexpected exception while checking supported"
-                            " feature via command: %s") % full_args)
+            LOG.exception(_LE("Unexpected exception while checking supported"
+                              " feature via command: %s"), full_args)
             return False
         else:
             return True
@@ -102,7 +103,7 @@ def vf_management_supported(root_helper):
             LOG.debug("ip link command does not support vf capability")
             return False
     except ip_link_support.UnsupportedIpLinkCommand:
-        LOG.exception(_("Unexpected exception while checking supported "
-                        "ip link command"))
+        LOG.exception(_LE("Unexpected exception while checking supported "
+                          "ip link command"))
         return False
     return True
index b6a5b601b89901ca4868f86d24e0e838e51dd3c1..87bae80e423e1ad0a2fe3e181ec45a59d341e26a 100644 (file)
@@ -38,19 +38,19 @@ class BoolOptCallback(cfg.BoolOpt):
 def check_ovs_vxlan():
     result = checks.vxlan_supported(root_helper=cfg.CONF.AGENT.root_helper)
     if not result:
-        LOG.error(_('Check for Open vSwitch VXLAN support failed. '
-                    'Please ensure that the version of openvswitch '
-                    'being used has VXLAN support.'))
+        LOG.error(_LE('Check for Open vSwitch VXLAN support failed. '
+                      'Please ensure that the version of openvswitch '
+                      'being used has VXLAN support.'))
     return result
 
 
 def check_ovs_patch():
     result = checks.patch_supported(root_helper=cfg.CONF.AGENT.root_helper)
     if not result:
-        LOG.error(_('Check for Open vSwitch patch port support failed. '
-                    'Please ensure that the version of openvswitch '
-                    'being used has patch port support or disable features '
-                    'requiring patch ports (gre/vxlan, etc.).'))
+        LOG.error(_LE('Check for Open vSwitch patch port support failed. '
+                      'Please ensure that the version of openvswitch '
+                      'being used has patch port support or disable features '
+                      'requiring patch ports (gre/vxlan, etc.).'))
     return result
 
 
@@ -67,9 +67,9 @@ def check_arp_responder():
     result = checks.arp_responder_supported(
         root_helper=cfg.CONF.AGENT.root_helper)
     if not result:
-        LOG.error(_('Check for Open vSwitch ARP responder support failed. '
-                    'Please ensure that the version of openvswitch '
-                    'being used has ARP flows support.'))
+        LOG.error(_LE('Check for Open vSwitch ARP responder support failed. '
+                      'Please ensure that the version of openvswitch '
+                      'being used has ARP flows support.'))
     return result
 
 
index 5615c6c6f649f87e1d84261715d0afee28c14865..e31c997459b4d61005b8bbe8ab78e8fe94212c0c 100644 (file)
@@ -44,7 +44,8 @@ def _directory_to_check_translation(filename):
     # In order to try and speed up the integration of this we will
     # do it on a directory by directory basis. The last patch of the
     # series will remove this and the entire code base will be validated.
-    dirs = ["neutron/agent"]
+    dirs = ["neutron/agent",
+            "neutron/cmd"]
     return any([dir in filename for dir in dirs])