From c8983de01584743c26eb9b24a08b6986a657886e Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Fri, 14 Apr 2017 23:58:00 +0000 Subject: [PATCH] Rename 'reboot' to 'restart' Change-Id: I5d821303f9e5efb80efeeb3b0d7b3c7c330fa13b Depends-On: I412fdb2123feb57b9fd5bcdb47ab389271d0d7e0 Closes-Bug: #1682679 --- zun_ui/api/client.py | 4 ++-- zun_ui/api/rest_api.py | 4 ++-- .../container/containers/actions.module.js | 10 +++++----- .../{reboot.service.js => restart.service.js} | 20 +++++++++---------- .../static/dashboard/container/zun.service.js | 8 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) rename zun_ui/static/dashboard/container/containers/operations/{reboot.service.js => restart.service.js} (85%) diff --git a/zun_ui/api/client.py b/zun_ui/api/client.py index 21aaac1..bdefbb6 100644 --- a/zun_ui/api/client.py +++ b/zun_ui/api/client.py @@ -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): diff --git a/zun_ui/api/rest_api.py b/zun_ui/api/rest_api.py index 0fb1dca..e5fb1d8 100644 --- a/zun_ui/api/rest_api.py +++ b/zun_ui/api/rest_api.py @@ -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': diff --git a/zun_ui/static/dashboard/container/containers/actions.module.js b/zun_ui/static/dashboard/container/containers/actions.module.js index 73bea63..cb6189a 100644 --- a/zun_ui/static/dashboard/container/containers/actions.module.js +++ b/zun_ui/static/dashboard/container/containers/actions.module.js @@ -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({ diff --git a/zun_ui/static/dashboard/container/containers/operations/reboot.service.js b/zun_ui/static/dashboard/container/containers/operations/restart.service.js similarity index 85% rename from zun_ui/static/dashboard/container/containers/operations/reboot.service.js rename to zun_ui/static/dashboard/container/containers/operations/restart.service.js index 59d8a1d..5b95506 100644 --- a/zun_ui/static/dashboard/container/containers/operations/reboot.service.js +++ b/zun_ui/static/dashboard/container/containers/operations/restart.service.js @@ -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; diff --git a/zun_ui/static/dashboard/container/zun.service.js b/zun_ui/static/dashboard/container/zun.service.js index 0560587..277febf 100644 --- a/zun_ui/static/dashboard/container/zun.service.js +++ b/zun_ui/static/dashboard/container/zun.service.js @@ -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) {