]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix i18n messages in quantum.api.api_common
authorZhongyue Luo <zhongyue.nah@intel.com>
Mon, 21 Jan 2013 01:56:13 +0000 (09:56 +0800)
committerZhongyue Luo <zhongyue.nah@intel.com>
Mon, 21 Jan 2013 09:08:21 +0000 (17:08 +0800)
Change-Id: I30dc9ad76dbfb6cc038c283d81e449cf64d7ffec

quantum/api/api_common.py

index e9bb12fcfa9241a41f8cc0da19d64ee09f9bd322..2e781e66cbb14cc70b7ffcfaa57ebba1ea08c841 100644 (file)
@@ -45,15 +45,15 @@ class QuantumController(object):
             data = body[self._resource_name]
         except KeyError:
             # raise if _resource_name is not in req body.
-            raise exc.HTTPBadRequest("Unable to find '%s' in request body"
-                                     self._resource_name)
+            raise exc.HTTPBadRequest(_("Unable to find '%s' in request body") %
+                                     self._resource_name)
         for param in params:
             param_name = param['param-name']
             param_value = data.get(param_name, None)
             # If the parameter wasn't found and it was required, return 400
             if param_value is None and param['required']:
-                msg = ("Failed to parse request. " +
-                       "Parameter: " + param_name + " not specified")
+                msg = (_("Failed to parse request. "
+                         "Parameter '%s' not specified") % param_name)
                 for line in msg.split('\n'):
                     LOG.error(line)
                 raise exc.HTTPBadRequest(msg)