Merge "Rename 'reboot' to 'restart'"

This commit is contained in:
Jenkins 2017-04-17 08:12:31 +00:00 committed by Gerrit Code Review
commit 07866d2ca4
5 changed files with 23 additions and 23 deletions

View File

@ -112,8 +112,8 @@ def container_stop(request, id, timeout):
return zunclient(request).containers.stop(id, timeout)
def container_reboot(request, id, timeout):
return zunclient(request).containers.reboot(id, timeout)
def container_restart(request, id, timeout):
return zunclient(request).containers.restart(id, timeout)
def container_pause(request, id):

View File

@ -66,9 +66,9 @@ class ContainerActions(generic.View):
elif action == 'stop':
timeout = request.DATA.get("timeout") or 10
return client.container_stop(request, id, timeout)
elif action == 'reboot':
elif action == 'restart':
timeout = request.DATA.get("timeout") or 10
return client.container_reboot(request, id, timeout)
return client.container_restart(request, id, timeout)
elif action == 'pause':
return client.container_pause(request, id)
elif action == 'unpause':

View File

@ -37,7 +37,7 @@
'horizon.dashboard.container.containers.delete-force.service',
'horizon.dashboard.container.containers.start.service',
'horizon.dashboard.container.containers.stop.service',
'horizon.dashboard.container.containers.reboot.service',
'horizon.dashboard.container.containers.restart.service',
'horizon.dashboard.container.containers.pause.service',
'horizon.dashboard.container.containers.unpause.service',
'horizon.dashboard.container.containers.execute.service',
@ -54,7 +54,7 @@
deleteContainerForceService,
startContainerService,
stopContainerService,
rebootContainerService,
restartContainerService,
pauseContainerService,
unpauseContainerService,
executeContainerService,
@ -107,10 +107,10 @@
}
})
.append({
id: 'rebootContainerAction',
service: rebootContainerService,
id: 'restartContainerAction',
service: restartContainerService,
template: {
text: gettext('Reboot Container')
text: gettext('Restart Container')
}
})
.append({

View File

@ -17,15 +17,15 @@
/**
* @ngDoc factory
* @name horizon.dashboard.container.containers.reboot.service
* @name horizon.dashboard.container.containers.restart.service
* @Description
* reboot container.
* restart container.
*/
angular
.module('horizon.dashboard.container.containers')
.factory('horizon.dashboard.container.containers.reboot.service', rebootService);
.factory('horizon.dashboard.container.containers.restart.service', restartService);
rebootService.$inject = [
restartService.$inject = [
'horizon.app.core.openstack-service-api.zun',
'horizon.dashboard.container.containers.basePath',
'horizon.dashboard.container.containers.resourceType',
@ -36,7 +36,7 @@
'horizon.framework.widgets.toast.service'
];
function rebootService(
function restartService(
zun, basePath, resourceType, actionResult, gettext, $qExtensions, modal, toast
) {
// schema
@ -44,7 +44,7 @@
type: "object",
properties: {
timeout: {
title: gettext("Reboot Container"),
title: gettext("Restart Container"),
type: "number",
minimum: 1
}
@ -75,7 +75,7 @@
var model;
var message = {
success: gettext('Container %s was successfully rebooted.')
success: gettext('Container %s was successfully restarted.')
};
var service = {
@ -105,8 +105,8 @@
};
// modal config
var config = {
"title": gettext('Reboot Container'),
"submitText": gettext('Reboot'),
"title": gettext('Restart Container'),
"submitText": gettext('Restart'),
"schema": schema,
"form": form,
"model": model
@ -118,7 +118,7 @@
var name = context.model.name;
delete context.model.id;
delete context.model.name;
return zun.rebootContainer(id, context.model).then(function() {
return zun.restartContainer(id, context.model).then(function() {
toast.add('success', interpolate(message.success, [name]));
var result = actionResult.getActionResult().updated(resourceType, id);
return result.result;

View File

@ -36,7 +36,7 @@
startContainer: startContainer,
stopContainer: stopContainer,
logsContainer: logsContainer,
rebootContainer: rebootContainer,
restartContainer: restartContainer,
pauseContainer: pauseContainer,
unpauseContainer: unpauseContainer,
executeContainer: executeContainer,
@ -101,9 +101,9 @@
return apiService.get(containersPath + id + '/logs').error(error(msg));
}
function rebootContainer(id, params) {
var msg = gettext('Unable to reboot Container.');
return apiService.post(containersPath + id + '/reboot', params).error(error(msg));
function restartContainer(id, params) {
var msg = gettext('Unable to restart Container.');
return apiService.post(containersPath + id + '/restart', params).error(error(msg));
}
function pauseContainer(id) {