]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
lock_many: Include username in target keys
authorZack Cerza <zack@redhat.com>
Fri, 14 Jan 2022 20:21:34 +0000 (13:21 -0700)
committerZack Cerza <zack@redhat.com>
Mon, 28 Mar 2022 21:26:17 +0000 (15:26 -0600)
So that we can actually support different usernames per node.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/lock/ops.py

index 853879a6a9772862e7d26b66517ae8e69912568c..b0c7d8033fbd9c58d5ebf8b3ffa3a162975af40d 100644 (file)
@@ -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: