Removes redundant code in quantum.api.api_common
Fixes bug #1102313 Change-Id: Ie321c48ae6d38f013e1ef8471df4d86b63b28931
This commit is contained in:
parent
0a1681cea8
commit
34c83c0215
@ -15,11 +15,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
from quantum.openstack.common import log as logging
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -49,13 +49,12 @@ class QuantumController(object):
|
|||||||
self._resource_name)
|
self._resource_name)
|
||||||
for param in params:
|
for param in params:
|
||||||
param_name = param['param-name']
|
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 the parameter wasn't found and it was required, return 400
|
||||||
if param_value is None and param['required']:
|
if param_value is None and param['required']:
|
||||||
msg = (_("Failed to parse request. "
|
msg = (_("Failed to parse request. "
|
||||||
"Parameter '%s' not specified") % param_name)
|
"Parameter '%s' not specified") % param_name)
|
||||||
for line in msg.split('\n'):
|
LOG.error(msg)
|
||||||
LOG.error(line)
|
|
||||||
raise exc.HTTPBadRequest(msg)
|
raise exc.HTTPBadRequest(msg)
|
||||||
data[param_name] = param_value or param.get('default-value')
|
data[param_name] = param_value or param.get('default-value')
|
||||||
return body
|
return body
|
||||||
|
Loading…
Reference in New Issue
Block a user