From 723063a25e7e943be4fcf05b4c7ff181fa321f0e Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 14 Jan 2022 13:21:34 -0700 Subject: [PATCH] lock_many: Include username in target keys So that we can actually support different usernames per node. Signed-off-by: Zack Cerza --- teuthology/lock/ops.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/teuthology/lock/ops.py b/teuthology/lock/ops.py index 853879a6a9..b0c7d8033f 100644 --- a/teuthology/lock/ops.py +++ b/teuthology/lock/ops.py @@ -116,8 +116,13 @@ def lock_many(ctx, num, machine_type, user=None, description=None, headers={'content-type': 'application/json'}, ) if response.ok: - machines = {misc.canonicalize_hostname(machine['name']): - machine['ssh_pub_key'] for machine in response.json()} + machines = dict() + for machine in response.json(): + key = misc.canonicalize_hostname( + machine['name'], + user=machine.get('user'), + ) + machines[key] = machine['ssh_pub_key'] log.debug('locked {machines}'.format( machines=', '.join(machines.keys()))) if machine_type in vm_types: -- 2.39.5