Return empty dict in controller(Urgent)
1. What is the problem? After updated to version 1.2, the WSGI framework we use, pecan has a behaviour that if the handle function return None, the setting of resonse status code will not take effect. In the deletion handle functions of pod and pod-binding controllers, we set the response status code but return None, thus the status code is not changed and our tests fail. 2. What is the solution to the problem? Return an empty dict in the deletion handle functions. 3. What the features need to be implemented to the Tricircle to realize the solution? No new features. Change-Id: I4bc44d2bc774fbe0cd9f820361d35077c83f3973
This commit is contained in:
parent
9d9c69ee48
commit
85df9c9c5f
|
@ -175,6 +175,7 @@ class PodsController(rest.RestController):
|
|||
az_ag.delete_ag(context, ag['id'])
|
||||
core.delete_resource(context, models.Pod, _id)
|
||||
pecan.response.status = 200
|
||||
return {}
|
||||
except t_exc.ResourceNotFound:
|
||||
return Response(_('Pod not found'), 404)
|
||||
except Exception as e:
|
||||
|
@ -317,6 +318,7 @@ class BindingsController(rest.RestController):
|
|||
with context.session.begin():
|
||||
core.delete_resource(context, models.PodBinding, _id)
|
||||
pecan.response.status = 200
|
||||
return {}
|
||||
except t_exc.ResourceNotFound:
|
||||
pecan.abort(404, _('Pod binding not found'))
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue