Fix `'NoneType' object has no attribute 'update'` when receiver params are not defined but a request contains data

When receiver doesn't have defined params, receiver.params gets None from the DB.
After getting the receiver, senlin is trying to apply params for the request when they are defined.
But `update` method doesn't work for None type.
The solution is to set emtpy dictionary for receiver.params when they are not defined.

Change-Id: Ib0fa9ca7c8bde8d6f6d15434ecacd80df4e91157
Closes-Bug: #1808988
This commit is contained in:
Pavel Sinkevych 2018-12-14 17:19:29 +03:00
parent 29ed02378f
commit c220ce0713
1 changed files with 2 additions and 0 deletions

View File

@ -2537,6 +2537,8 @@ class EngineService(service.Service):
raise exception.BadRequest(msg=msg)
data = copy.deepcopy(receiver.params)
if data is None:
data = {}
if params:
data.update(params)