Commit 555309c5 authored by André Anjos's avatar André Anjos 💬

Merge branch '93_follow_raise_on_error_property' into 'master'

Handle docker exception following the raise on error property for the new environment discovery

Closes #93

See merge request !108
parents 13188307 c2b8387d
Pipeline #36622 passed with stages
in 23 minutes and 42 seconds
......@@ -416,11 +416,31 @@ class Host(object):
client = docker.from_env()
databases = client.images.list(filters={"label": ["beat.env.type=database"]})
db_environments = _process_image_list(databases)
try:
databases = client.images.list(
filters={"label": ["beat.env.type=database"]}
)
except Exception as e:
if self.raise_on_errors:
raise
else:
logger.error("Docker error: {}".format(e))
return {}, {}
else:
db_environments = _process_image_list(databases)
executors = client.images.list(filters={"label": ["beat.env.type=execution"]})
environments = _process_image_list(executors)
try:
executors = client.images.list(
filters={"label": ["beat.env.type=execution"]}
)
except Exception as e:
if self.raise_on_errors:
raise
else:
logger.error("Docker error: {}".format(e))
return {}, {}
else:
environments = _process_image_list(executors)
logger.debug(
"Found %d environments and %d database environments",
......
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