Remove weak pattern in API

Bug #834008 reported by Salvatore Orlando
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Salvatore Orlando
quantum (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Precise by Yolanda Robla

Bug Description

In quantum/api/api_common.py request body parameter are checked with a construct like the following:

if param_value and param['required']:

this might work quite well if param_value is a string, but can lead to unexpect behaviour for any other kind of data type.

As noted by Dan, it should be replace with a different condition, as follows:

if not param_value is None and param['Required']:

Related branches

Changed in quantum:
assignee: nobody → Salvatore Orlando (salvatore-orlando)
milestone: none → diablo-rbp
Changed in quantum:
status: New → In Progress
dan wendlandt (danwent)
Changed in quantum:
status: In Progress → Fix Committed
dan wendlandt (danwent)
Changed in quantum:
status: Fix Committed → Fix Released
Changed in quantum (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.