From 762bd3a8013ef60df24ce02f52a22faa7f575d34 Mon Sep 17 00:00:00 2001 From: Konstantin Suvorov Date: Tue, 9 Feb 2016 15:34:30 +0300 Subject: [PATCH] Fix docker container restart restart_containers(containers.running) may try to restart containers that are deleted when looping through get_differing_containers() fix this by refreshing list after first loop --- lib/ansible/modules/cloud/docker/docker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index 6422f449ef0..3d8521b4d43 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -1782,6 +1782,8 @@ def restarted(manager, containers, count, name): manager.stop_containers([container]) manager.remove_containers([container]) + containers.refresh() + manager.restart_containers(containers.running) started(manager, containers, count, name)