diff --git a/zun_ui/api/client.py b/zun_ui/api/client.py index a81f01d..bfcf7ce 100644 --- a/zun_ui/api/client.py +++ b/zun_ui/api/client.py @@ -103,12 +103,12 @@ def container_start(request, id): return zunclient(request).containers.start(id) -def container_stop(request, id): - return zunclient(request).containers.stop(id) +def container_stop(request, id, timeout): + return zunclient(request).containers.stop(id, timeout) -def container_reboot(request, id): - return zunclient(request).containers.reboot(id) +def container_reboot(request, id, timeout): + return zunclient(request).containers.reboot(id, timeout) def container_pause(request, id): diff --git a/zun_ui/api/rest_api.py b/zun_ui/api/rest_api.py index 7446910..0b1ea7e 100644 --- a/zun_ui/api/rest_api.py +++ b/zun_ui/api/rest_api.py @@ -64,9 +64,11 @@ class ContainerActions(generic.View): if action == 'start': return client.container_start(request, id) elif action == 'stop': - return client.container_stop(request, id) + timeout = 10 + return client.container_stop(request, id, timeout) elif action == 'reboot': - return client.container_reboot(request, id) + timeout = 10 + return client.container_reboot(request, id, timeout) elif action == 'pause': return client.container_pause(request, id) elif action == 'unpause': @@ -75,7 +77,7 @@ class ContainerActions(generic.View): command = request.DATA.get("command") return client.container_execute(request, id, command) elif action == 'kill': - signal = request.DATA.get("signal") + signal = request.DATA.get("signal") or None return client.container_kill(request, id, signal)