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)
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):

View File

@ -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)
elif action == 'attach':
return client.container_attach(request, id)