Add username to detailed node list output

With the static driver it is possible to have multiple static nodes
defined that only differ by their username. In order to be able to
distinguish them, include the username in the output of the
"nodepool list --detail" output.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I702ccbf412731ef3400eb722386629356a244334
This commit is contained in:
Dr. Jens Harbott 2022-11-07 07:44:08 +01:00
parent 3f6aaed55f
commit abe6ba9759
3 changed files with 4 additions and 2 deletions

View File

@ -198,7 +198,7 @@ class NodePoolCmd(NodepoolApp):
'public_ipv4', 'ipv6', 'state', 'age', 'locked']
if detail:
fields.extend(['pool', 'hostname', 'private_ipv4', 'AZ',
'connection_port', 'launcher',
'username', 'connection_port', 'launcher',
'allocated_to', 'hold_job',
'comment', 'user_data', 'driver_data'])
results = status.node_list(self.zk, node_id)

View File

@ -123,6 +123,7 @@ def node_list(zk, node_id=None):
("hostname", "Hostname"),
("private_ipv4", "Private IPv4"),
("AZ", "AZ"),
("username", "Username"),
("connection_port", "Port"),
("launcher", "Launcher"),
("allocated_to", "Allocated To"),
@ -155,6 +156,7 @@ def node_list(zk, node_id=None):
node.hostname,
node.private_ipv4,
node.az,
node.username,
node.connection_port,
node.launcher,
node.allocated_to,

View File

@ -77,7 +77,7 @@ class TestNodepoolCMD(tests.DBTestCase):
col_count = 9
if detail:
cmd += ['--detail']
col_count = 20
col_count = 21
if not validate_col_count:
col_count = 0
self.assert_listed(configfile, cmd, 6, status, node_cnt, col_count)