From: Kyr Shatskyy Date: Fri, 10 Jan 2025 14:09:24 +0000 (+0100) Subject: lock/cli: don't update inventory if failed to create a vm X-Git-Tag: 1.2.2~40^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=62f4df30dccb9d8fd2c2dbfae7929441a0d46e4d;p=teuthology.git lock/cli: don't update inventory if failed to create a vm If we were not able to create a vm we don't need to update machine's inventory, because there is going to be an ssh connection established to the host and teuthology gets stuck infinitely trying to connect to the machine which does not exist. Signed-off-by: Kyr Shatskyy --- diff --git a/teuthology/lock/cli.py b/teuthology/lock/cli.py index e5f97fb634..ed4f28bd5a 100644 --- a/teuthology/lock/cli.py +++ b/teuthology/lock/cli.py @@ -178,12 +178,14 @@ def main(ctx): # Update keys last updatekeys_machines = list() else: - machines_to_update.append(machine) ops.update_nodes([machine], True) - teuthology.provision.create_if_vm( + created = teuthology.provision.create_if_vm( ctx, misc.canonicalize_hostname(machine), ) + # do not try to update inventory if failed to create vm + if created: + machines_to_update.append(machine) with teuthology.parallel.parallel() as p: ops.update_nodes(reimage_machines, True) for machine in reimage_machines: