Blame SOURCES/0043-v2v-o-rhv-upload-check-for-a-valid-image-transfer-ri.patch

10436e
From d02694e659ebe1ecad29f8461d87eda6a1f8faa2 Mon Sep 17 00:00:00 2001
10436e
From: Pino Toscano <ptoscano@redhat.com>
10436e
Date: Thu, 19 Sep 2019 09:52:41 +0200
10436e
Subject: [PATCH] v2v: -o rhv-upload: check for a valid image transfer right
10436e
 away
10436e
10436e
Check for the INITIALIZING state of the image transfer right away,
10436e
without waiting 5 seconds even before the first time: this way, if the
10436e
transfer is already in the right state then there is no need to wait.
10436e
---
10436e
 v2v/rhv-upload-plugin.py | 2 +-
10436e
 1 file changed, 1 insertion(+), 1 deletion(-)
10436e
10436e
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
10436e
index 6ec74a5d4..7f62b4e3b 100644
10436e
--- a/v2v/rhv-upload-plugin.py
10436e
+++ b/v2v/rhv-upload-plugin.py
10436e
@@ -190,13 +190,13 @@ def open(readonly):
10436e
     # actual transfer can start when its status is "Transferring".
10436e
     endt = time.time() + timeout
10436e
     while True:
10436e
-        time.sleep(5)
10436e
         transfer = transfer_service.get()
10436e
         if transfer.phase != types.ImageTransferPhase.INITIALIZING:
10436e
             break
10436e
         if time.time() > endt:
10436e
             raise RuntimeError("timed out waiting for transfer status "
10436e
                                "!= INITIALIZING")
10436e
+        time.sleep(5)
10436e
 
10436e
     # Now we have permission to start the transfer.
10436e
     if params['rhv_direct']:
10436e
-- 
10436e
2.26.2
10436e