Commit e3a4d357 authored by Daniele Venzano's avatar Daniele Venzano

Sometimes Swarm resets the connection

parent 32d463cf
......@@ -16,6 +16,8 @@
import time
import logging
import requests.exceptions
try:
from kazoo.client import KazooClient
except ImportError:
......@@ -131,6 +133,10 @@ class SwarmClient:
if cont is not None:
self.cli.remove_container(container=cont.get('Id'), force=True)
raise ZoeException(e.explanation.decode('utf-8'))
except requests.exceptions.ConnectionError:
if cont is not None:
self.cli.remove_container(container=cont.get('Id'), force=True)
raise ZoeException('Connection error while creating the container')
info = self.inspect_container(cont.get('Id'))
return info
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment