From eb9121a7330abbffacf0fb8708121287bcb78e7e Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 30 Jun 2022 14:31:06 -0700 Subject: [PATCH] Include user/driver data in node detail list This lets operators see the user_data and driver_data in the node list when passing --detail. That can be useful for identifying issues with the metastatic driver, or any other debugging which would benefit from seeing that data. Change-Id: I2f36ce98a183b7a8e289376f2228b6370900a057 --- nodepool/cmd/nodepoolcmd.py | 2 +- nodepool/status.py | 8 ++++++-- nodepool/tests/unit/test_commands.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nodepool/cmd/nodepoolcmd.py b/nodepool/cmd/nodepoolcmd.py index 97b32123e..65e3f4257 100644 --- a/nodepool/cmd/nodepoolcmd.py +++ b/nodepool/cmd/nodepoolcmd.py @@ -200,7 +200,7 @@ class NodePoolCmd(NodepoolApp): fields.extend(['pool', 'hostname', 'private_ipv4', 'AZ', 'connection_port', 'launcher', 'allocated_to', 'hold_job', - 'comment']) + 'comment', 'user_data', 'driver_data']) results = status.node_list(self.zk, node_id) print(status.output(results, 'pretty', fields)) diff --git a/nodepool/status.py b/nodepool/status.py index 1df4e46e0..1e9855372 100644 --- a/nodepool/status.py +++ b/nodepool/status.py @@ -127,7 +127,9 @@ def node_list(zk, node_id=None): ("launcher", "Launcher"), ("allocated_to", "Allocated To"), ("hold_job", "Hold Job"), - ("comment", "Comment") + ("comment", "Comment"), + ("user_data", "User Data"), + ("driver_data", "Driver Data"), ] headers_table = OrderedDict(headers_table) @@ -158,7 +160,9 @@ def node_list(zk, node_id=None): node.launcher, node.allocated_to, node.hold_job, - node.comment + node.comment, + node.user_data, + node.driver_data, ] return values diff --git a/nodepool/tests/unit/test_commands.py b/nodepool/tests/unit/test_commands.py index 5db3d44c1..a993402c7 100644 --- a/nodepool/tests/unit/test_commands.py +++ b/nodepool/tests/unit/test_commands.py @@ -76,7 +76,7 @@ class TestNodepoolCMD(tests.DBTestCase): col_count = 9 if detail: cmd += ['--detail'] - col_count = 18 + col_count = 20 if not validate_col_count: col_count = 0 self.assert_listed(configfile, cmd, 6, status, node_cnt, col_count)