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

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