Fixed cluster_update operation error

The cluster identity could have been changed during update, so we use
the UUID as key for post-update retrieval.
This commit is contained in:
tengqm
2015-03-03 18:01:19 +08:00
parent 4fc573db5a
commit 3713c4c7c2

View File

@@ -532,9 +532,9 @@ def do_cluster_delete(sc, args):
help=_('Name or ID of cluster to be updated.'))
def do_cluster_update(sc, args):
'''Update the cluster.'''
cluster = sc.get(models.Cluster, {'id': args.id})
params = {
'id': args.id,
'id': cluster.id,
'name': args.name,
'profile_id': args.profile,
'parent': args.parent,
@@ -543,7 +543,7 @@ def do_cluster_update(sc, args):
}
sc.update(models.Cluster, params)
_show_cluster(sc, args.id)
_show_cluster(sc, cluster.id)
@utils.arg('id', metavar='<CLUSTER>',