Fix getting update params

Change-Id: I0724417cfe974c23813117cf3733de89f8f5f1c5
This commit is contained in:
Lingxian Kong 2017-08-01 17:45:02 +12:00
parent d768711939
commit 13e2d13195
3 changed files with 6 additions and 6 deletions

View File

@ -198,8 +198,8 @@ class FunctionsController(rest.RestController):
"""
values = {}
for key in UPDATE_ALLOWED:
if key in func.to_dict():
values.update({key: func.to_dict().get(key)})
if func.to_dict().get(key) is not None:
values.update({key: func.to_dict()[key]})
LOG.info('Update resource, params: %s', values,
resource={'type': self.type, 'id': id})

View File

@ -125,8 +125,8 @@ class JobsController(rest.RestController):
"""
values = {}
for key in UPDATE_ALLOWED:
if key in job.to_dict():
values.update({key: job.to_dict().get(key)})
if job.to_dict().get(key) is not None:
values.update({key: job.to_dict()[key]})
LOG.info('Update resource, params: %s', values,
resource={'type': self.type, 'id': id})

View File

@ -113,8 +113,8 @@ class RuntimesController(rest.RestController):
"""
values = {}
for key in UPDATE_ALLOWED:
if key in runtime.to_dict():
values.update({key: runtime.to_dict().get(key)})
if runtime.to_dict().get(key) is not None:
values.update({key: runtime.to_dict()[key]})
LOG.info('Update resource, params: %s', values,
resource={'type': self.type, 'id': id})