mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
v2v: -o rhv-upload: check for a valid image transfer right away
Check for the INITIALIZING state of the image transfer right away, without waiting 5 seconds even before the first time: this way, if the transfer is already in the right state then there is no need to wait.
This commit is contained in:
@@ -188,7 +188,6 @@ def open(readonly):
|
||||
# actual transfer can start when its status is "Transferring".
|
||||
endt = time.time() + timeout
|
||||
while True:
|
||||
time.sleep(5)
|
||||
transfer = transfer_service.get()
|
||||
if transfer.phase != types.ImageTransferPhase.INITIALIZING:
|
||||
break
|
||||
@@ -196,6 +195,7 @@ def open(readonly):
|
||||
transfer_service.cancel()
|
||||
raise RuntimeError("timed out waiting for transfer status "
|
||||
"!= INITIALIZING")
|
||||
time.sleep(5)
|
||||
|
||||
# Now we have permission to start the transfer.
|
||||
if params['rhv_direct']:
|
||||
|
||||
Reference in New Issue
Block a user