Commit e1a88f0f authored by Daniele Venzano's avatar Daniele Venzano
Browse files

Catch a requests exception that docker-py does not catch

parent 9bdb21b0
Pipeline #4529 passed with stages
in 2 minutes and 51 seconds
......@@ -338,6 +338,8 @@ class SwarmClient:
ret = self.cli.containers.list(all=True)
except docker.errors.APIError as ex:
raise ZoeException(str(ex))
except requests.exceptions.RequestException as ex:
raise ZoeException(str(ex))
conts = []
for cont_info in ret:
match = True
"""Classes to hold the system state and simulated container/service placements"""
import logging
from zoe_lib.state.sql_manager import Execution, Service
from zoe_master.stats import ClusterStats, NodeStats
log = logging.getLogger(__name__)
class SimulatedNode:
"""A simulated node where containers can be run"""
......@@ -72,6 +76,7 @@ class SimulatedPlatform:
if len(candidate_nodes) == 0: # this service does not fit anywhere
log.debug('Cannot fit essential service {}, bailing out'.format(
return False
candidate_nodes.sort(key=lambda n: n.container_count) # smallest first
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