basho-labs / riak-mesos-tools

CLI and other tools for interacting with the Riak Mesos Framework.
Apache License 2.0
3 stars 6 forks source link

Check task state when calculating API URL #32

Closed sanmiguel closed 8 years ago

sanmiguel commented 8 years ago

When attempting to find the scheduler's API port, we use:

        client = self.ctx.marathon_client()
        tasks = client.get_tasks(self.ctx.framework)
        if len(tasks) != 0:

and simply assume that the first task in the list is the scheduler. However, it looks like marathon now also includes any lost tasks it knows about.

We should inspect each task object's state field for "TASK_RUNNING" before attempting to test the healthcheck.