Fix cluster update instead of cluster template update

In Change I2f0126fbf2f7396dda504b988ee11659824fcde8, the function that should
be patched is cluster_update() instead of cluster_template_update().
cluster_template_update() allows for more than /node_count to be patched.

Change-Id: I9c7995cf2393edbcc6c2488338a1230213248e95
This commit is contained in:
Jake Yip 2018-10-30 17:03:04 +11:00
parent 4c9c1e5b35
commit 85a463190f

View File

@ -143,11 +143,6 @@ def cluster_template_update(request, id, **kwargs):
old = magnumclient(request).cluster_templates.get(id).to_dict()
old = _cleanup_params(CLUSTER_TEMPLATE_CREATE_ATTRS, False, **old)
patch = _create_patches(old, new)
# NOTE(flwang): Now Magnum only support updating the node count for
# cluster upddate action. So let's simplify it by only passing the
# /node_count dict which can avoid many potential bugs.
patch = [d for d in patch if d['path']
in CLUSTER_UPDATE_ALLOWED_PROPERTIES]
return magnumclient(request).cluster_templates.update(id, patch)
@ -177,6 +172,13 @@ def cluster_update(request, id, **kwargs):
old = magnumclient(request).clusters.get(id).to_dict()
old = _cleanup_params(CLUSTER_CREATE_ATTRS, False, **old)
patch = _create_patches(old, new)
# NOTE(flwang): Now Magnum only support updating the node count for
# cluster update action. So let's simplify it by only passing the
# /node_count dict which can avoid many potential bugs.
patch = [d for d in patch if d['path']
in CLUSTER_UPDATE_ALLOWED_PROPERTIES]
return magnumclient(request).clusters.update(id, patch, rollback=rollback)