From c792f32ad262a04fa1fe7beef4e7c5cf05827b3c Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Tue, 17 May 2022 07:55:25 +0200 Subject: [PATCH] copr-be-dev: at least warn that we re-try the virt-install command --- roles/copr/backend/templates/provision/libvirt-new | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/copr/backend/templates/provision/libvirt-new b/roles/copr/backend/templates/provision/libvirt-new index aa9201092e..079e816e1d 100755 --- a/roles/copr/backend/templates/provision/libvirt-new +++ b/roles/copr/backend/templates/provision/libvirt-new @@ -311,12 +311,14 @@ class LibvirtSpawner: """ Retry command till it succeeds """ + if not exception_message: + exception_message = "Command failed" for _ in range(attempts): if not self.call(cmd, stdout=sys.stderr): return + self.log.warning("%s, retry after %s", exception_message, + sleep_seconds) time.sleep(sleep_seconds) - if not exception_message: - exception_message = "Command failed" exception_message += f" ({str(cmd)}, attempts={attempts})" raise Exception(exception_message)