ArmandGrillet commented on a change in pull request #345: Allow `mesos task
exec/attach` for any task_id
URL: https://github.com/apache/mesos/pull/345#discussion_r338908237
##########
File path: src/python/cli_new/lib/cli/mesos.py
##########
@@ -114,25 +114,25 @@ def get_container_id(task):
" Please try again.")
-def get_tasks(master):
+def get_tasks(master, query=None):
"""
Get the tasks in a Mesos cluster.
"""
endpoint = "tasks"
key = "tasks"
try:
- data = http.get_json(master, endpoint)
+ data = http.get_json(master, endpoint, query)
except Exception as exception:
raise CLIException(
- "Could not open '/{endpoint}' on master: {error}"
- .format(endpoint=endpoint, error=exception))
+ "Could not open '/{endpoint}' with query: {query} on master:
{error}"
+ .format(endpoint=endpoint, query=query, error=exception))
if not key in data:
raise CLIException(
"Missing '{key}' key in data retrieved"
- " from master on '/{endpoint}'"
- .format(key=key, endpoint=endpoint))
+ " from master on '/{endpoint}' with query: {query}}"
Review comment:
Same comment as the previous one, returning an exception with `query: None`
could be confusing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services