Merge "Add rollback option for cluster"

This commit is contained in:
Jenkins 2017-07-21 05:15:08 +00:00 committed by Gerrit Code Review
commit ac359325c5
2 changed files with 12 additions and 1 deletions

View File

@ -140,16 +140,18 @@ def cluster_template_show(request, id):
def cluster_create(request, **kwargs):
kwargs.pop("rollback")
args = _cleanup_params(CLUSTER_CREATE_ATTRS, True, **kwargs)
return magnumclient(request).clusters.create(**args)
def cluster_update(request, id, **kwargs):
rollback = kwargs.pop("rollback")
new = _cleanup_params(CLUSTER_CREATE_ATTRS, True, **kwargs)
old = magnumclient(request).clusters.get(id).to_dict()
old = _cleanup_params(CLUSTER_CREATE_ATTRS, False, **old)
patch = _create_patches(old, new)
return magnumclient(request).clusters.update(id, patch)
return magnumclient(request).clusters.update(id, patch, rollback=rollback)
def cluster_delete(request, id):

View File

@ -81,6 +81,10 @@
'docker_volume_size': {
title: gettext('Docker Volume Size (GB)'),
type: 'number'
},
'rollback': {
title: gettext('Rollback cluster on update failure'),
type: 'boolean'
}
}
};
@ -145,6 +149,10 @@
placeholder: gettext('Specify the size in GB for the docker volume'),
description: dockerVolumeSizeDescription,
readonly: action === 'update'
},
{
key: 'rollback',
condition: action === 'create'
}
]
}
@ -209,6 +217,7 @@
master_count: null,
node_count: null,
docker_volume_size: "",
rollback: false,
discovery_url: "",
create_timeout: null,
keypair: ""