From 55fdf24192979c4121234f5a5ef55bb5927db34c Mon Sep 17 00:00:00 2001 From: tamarrow Date: Fri, 24 Feb 2017 16:56:01 -0800 Subject: [PATCH] task: add mesos agent ID to `dcos task` table (#915) This makes it easy to see a task and then SSH into the agent using either the private ip or the mesos id. --- cli/dcoscli/tables.py | 2 ++ cli/tests/unit/data/task.txt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/dcoscli/tables.py b/cli/dcoscli/tables.py index 6a7b1f7..6af9df1 100644 --- a/cli/dcoscli/tables.py +++ b/cli/dcoscli/tables.py @@ -40,12 +40,14 @@ def task_table(tasks): ("USER", lambda t: t.user()), ("STATE", lambda t: t["state"].split("_")[-1][0]), ("ID", lambda t: t["id"]), + ("MESOS ID", lambda t: t["slave_id"]), ]) tb = table(fields, tasks, sortby="NAME") tb.align["NAME"] = "l" tb.align["HOST"] = "l" tb.align["ID"] = "l" + tb.align["MESOS ID"] = "l" return tb diff --git a/cli/tests/unit/data/task.txt b/cli/tests/unit/data/task.txt index 9be3261..8c604b7 100644 --- a/cli/tests/unit/data/task.txt +++ b/cli/tests/unit/data/task.txt @@ -1,2 +1,2 @@ -NAME HOST USER STATE ID -test-app mock-hostname root R test-app.d44dd7f2-f9b7-11e4-bb43-56847afe9799 \ No newline at end of file +NAME HOST USER STATE ID MESOS ID +test-app mock-hostname root R test-app.d44dd7f2-f9b7-11e4-bb43-56847afe9799 20150513-185808-177048842-5050-1220-S0 \ No newline at end of file