]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Removes redundant code in quantum.api.api_common
authorZhongyue Luo <zhongyue.nah@intel.com>
Mon, 21 Jan 2013 08:57:46 +0000 (16:57 +0800)
committerZhongyue Luo <zhongyue.nah@intel.com>
Mon, 21 Jan 2013 09:09:27 +0000 (17:09 +0800)
Fixes bug #1102313

Change-Id: Ie321c48ae6d38f013e1ef8471df4d86b63b28931

quantum/api/api_common.py

index 2e781e66cbb14cc70b7ffcfaa57ebba1ea08c841..0dd1bf726bbdf65948b8c653f62507d7a0203023 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-
 from webob import exc
 
 from quantum.openstack.common import log as logging
 
+
 LOG = logging.getLogger(__name__)
 
 
@@ -49,13 +49,12 @@ class QuantumController(object):
                                      self._resource_name)
         for param in params:
             param_name = param['param-name']
-            param_value = data.get(param_name, None)
+            param_value = data.get(param_name)
             # 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 '%s' not specified") % param_name)
-                for line in msg.split('\n'):
-                    LOG.error(line)
+                LOG.error(msg)
                 raise exc.HTTPBadRequest(msg)
             data[param_name] = param_value or param.get('default-value')
         return body