Blob Blame History Raw
From 7b5ec5a6478276cec587c7d6a64b9a1ab26447b2 Mon Sep 17 00:00:00 2001
From: Nir Soffer <nirsof@gmail.com>
Date: Sat, 30 Jun 2018 01:39:03 +0300
Subject: [PATCH] v2v: rhv-upload-plugin: Optimize only direct upload

The optimization to start the transfer on the local host makes sense
only when using the rhv-direct=true option. When using a proxy, let the
engine choose a host.

(cherry picked from commit 891b5a0ec0f320acec0f06b64159eaf3dfbbfeaf)
---
 v2v/rhv-upload-plugin.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index 8e4052048..da309e288 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -148,8 +148,8 @@ def open(readonly):
     # Get a reference to the transfer service.
     transfers_service = system_service.image_transfers_service()
 
-    # Create a new image transfer.
-    host = find_host(connection)
+    # Create a new image transfer, using the local host is possible.
+    host = find_host(connection) if params['rhv_direct'] else None
     transfer = transfers_service.add(
         types.ImageTransfer(
             disk = types.Disk(id = disk.id),
-- 
2.21.0