Merge "Fixed the error on stop reboot and kill"

This commit is contained in:
Jenkins 2017-04-05 00:59:38 +00:00 committed by Gerrit Code Review
commit 2d1094c363
2 changed files with 9 additions and 7 deletions

View File

@ -108,12 +108,12 @@ def container_start(request, id):
return zunclient(request).containers.start(id) return zunclient(request).containers.start(id)
def container_stop(request, id): def container_stop(request, id, timeout):
return zunclient(request).containers.stop(id) return zunclient(request).containers.stop(id, timeout)
def container_reboot(request, id): def container_reboot(request, id, timeout):
return zunclient(request).containers.reboot(id) return zunclient(request).containers.reboot(id, timeout)
def container_pause(request, id): def container_pause(request, id):

View File

@ -64,9 +64,11 @@ class ContainerActions(generic.View):
if action == 'start': if action == 'start':
return client.container_start(request, id) return client.container_start(request, id)
elif action == 'stop': elif action == 'stop':
return client.container_stop(request, id) timeout = 10
return client.container_stop(request, id, timeout)
elif action == 'reboot': elif action == 'reboot':
return client.container_reboot(request, id) timeout = 10
return client.container_reboot(request, id, timeout)
elif action == 'pause': elif action == 'pause':
return client.container_pause(request, id) return client.container_pause(request, id)
elif action == 'unpause': elif action == 'unpause':
@ -75,7 +77,7 @@ class ContainerActions(generic.View):
command = request.DATA.get("command") command = request.DATA.get("command")
return client.container_execute(request, id, command) return client.container_execute(request, id, command)
elif action == 'kill': elif action == 'kill':
signal = request.DATA.get("signal") signal = request.DATA.get("signal") or None
return client.container_kill(request, id, signal) return client.container_kill(request, id, signal)
elif action == 'attach': elif action == 'attach':
return client.container_attach(request, id) return client.container_attach(request, id)