From 5745c807c994004657000d6508e36fdf6e448b8e Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Fri, 29 Jun 2018 03:05:36 +0000 Subject: [PATCH] status: add pool column to nodepool list output This helps debug pool quota usage. Change-Id: Id6cdef978e1ba80a4fea5e5bfa862755fb6d7e40 --- nodepool/cmd/nodepoolcmd.py | 2 +- nodepool/status.py | 2 ++ nodepool/tests/test_commands.py | 2 +- .../notes/nodepool-list-pool-detail-680f47814fd51427.yaml | 3 +++ 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/nodepool-list-pool-detail-680f47814fd51427.yaml diff --git a/nodepool/cmd/nodepoolcmd.py b/nodepool/cmd/nodepoolcmd.py index daf4adcfe..522556f0d 100755 --- a/nodepool/cmd/nodepoolcmd.py +++ b/nodepool/cmd/nodepoolcmd.py @@ -160,7 +160,7 @@ class NodePoolCmd(NodepoolApp): fields = ['id', 'provider', 'label', 'server_id', 'public_ipv4', 'ipv6', 'state', 'age', 'locked'] if detail: - fields.extend(['hostname', 'private_ipv4', 'AZ', + fields.extend(['pool', 'hostname', 'private_ipv4', 'AZ', 'connection_port', 'launcher', 'allocated_to', 'hold_job', 'comment']) diff --git a/nodepool/status.py b/nodepool/status.py index ca892c3c4..e21e9bb5d 100755 --- a/nodepool/status.py +++ b/nodepool/status.py @@ -119,6 +119,7 @@ def node_list(zk, node_id=None): ("state", "State"), ("age", "Age"), ("locked", "Locked"), + ("pool", "Pool"), ("hostname", "Hostname"), ("private_ipv4", "Private IPv4"), ("AZ", "AZ"), @@ -149,6 +150,7 @@ def node_list(zk, node_id=None): node.state, age(node.state_time), locked, + node.pool, node.hostname, node.private_ipv4, node.az, diff --git a/nodepool/tests/test_commands.py b/nodepool/tests/test_commands.py index eb40e6032..dbabd12e0 100644 --- a/nodepool/tests/test_commands.py +++ b/nodepool/tests/test_commands.py @@ -67,7 +67,7 @@ class TestNodepoolCMD(tests.DBTestCase): col_count = 9 if detail: cmd += ['--detail'] - col_count = 17 + col_count = 18 if not validate_col_count: col_count = 0 self.assert_listed(configfile, cmd, 6, status, node_cnt, col_count) diff --git a/releasenotes/notes/nodepool-list-pool-detail-680f47814fd51427.yaml b/releasenotes/notes/nodepool-list-pool-detail-680f47814fd51427.yaml new file mode 100644 index 000000000..5189940e2 --- /dev/null +++ b/releasenotes/notes/nodepool-list-pool-detail-680f47814fd51427.yaml @@ -0,0 +1,3 @@ +--- +features: + - The detailed nodepool list outputs the node's pool.