Merge "Just modify database when updating the name of container"
This commit is contained in:
commit
6b80d2a59f
@ -598,8 +598,14 @@ class ContainersController(base.Controller):
|
|||||||
if 'name' in patch:
|
if 'name' in patch:
|
||||||
patch['name'] = str(patch['name'])
|
patch['name'] = str(patch['name'])
|
||||||
context = pecan.request.context
|
context = pecan.request.context
|
||||||
compute_api = pecan.request.compute_api
|
if 'memory' not in patch and 'cpu' not in patch:
|
||||||
container = compute_api.container_update(context, container, patch)
|
for field, patch_val in patch.items():
|
||||||
|
if getattr(container, field) != patch_val:
|
||||||
|
setattr(container, field, patch_val)
|
||||||
|
container.save(context)
|
||||||
|
else:
|
||||||
|
compute_api = pecan.request.compute_api
|
||||||
|
container = compute_api.container_update(context, container, patch)
|
||||||
return view.format_container(context, pecan.request.host_url,
|
return view.format_container(context, pecan.request.host_url,
|
||||||
container.as_dict())
|
container.as_dict())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user