Fix scale when containers exit immediately

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2016-01-21 15:19:55 +00:00
commit 755c49b500
2 changed files with 8 additions and 5 deletions

View file

@ -228,11 +228,9 @@ class Service(object):
sorted_running_containers = sorted(
running_containers,
key=attrgetter('number'))
parallel_stop(
sorted_running_containers[-num_to_stop:],
dict(timeout=timeout))
parallel_remove(self.containers(stopped=True), {})
containers_to_stop = sorted_running_containers[-num_to_stop:]
parallel_stop(containers_to_stop, dict(timeout=timeout))
parallel_remove(containers_to_stop, {})
def create_container(self,
one_off=False,