Commit bb81c056 authored by nimrod's avatar nimrod
Browse files

Handle missing Compose projects.

parent 080a6307
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ def wait_for_project_health(project, timeout):
    docker_client.ping()
    while True:
        healths = get_project_containers_health(docker_client, project)
        if not healths:
            raise RuntimeError(f"No containers found for project {project}.")
        # pylint: disable=no-else-return
        if not get_unhealthy_project_containers(docker_client, project):
            return []
@@ -107,7 +109,10 @@ def main():
            "Compose project wasn't specified, the COMPOSE_PROJECT_NAME variable is missing from the environment and from the .env file."  # noqa: E501
        )

    try:
        unhealthy = wait_for_project_health(project, args.timeout)
    except Exception as e:  # pylint: disable=broad-except
        arg_parser.error(str(e))

    if not unhealthy:
        print(f"Project {project} is healthy.")