Blame SOURCES/0067-v2v-rhv-upload-plugin-Optimize-only-direct-upload.patch

e9bfca
From f1e11ab12c7e51f648a5efe056cf4ba9be4d9afa Mon Sep 17 00:00:00 2001
e9bfca
From: Nir Soffer <nirsof@gmail.com>
e9bfca
Date: Sat, 30 Jun 2018 01:39:03 +0300
e9bfca
Subject: [PATCH] v2v: rhv-upload-plugin: Optimize only direct upload
e9bfca
e9bfca
The optimization to start the transfer on the local host makes sense
e9bfca
only when using the rhv-direct=true option. When using a proxy, let the
e9bfca
engine choose a host.
e9bfca
e9bfca
(cherry picked from commit 891b5a0ec0f320acec0f06b64159eaf3dfbbfeaf)
e9bfca
---
e9bfca
 v2v/rhv-upload-plugin.py | 4 ++--
e9bfca
 1 file changed, 2 insertions(+), 2 deletions(-)
e9bfca
e9bfca
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
e9bfca
index 8e4052048..da309e288 100644
e9bfca
--- a/v2v/rhv-upload-plugin.py
e9bfca
+++ b/v2v/rhv-upload-plugin.py
e9bfca
@@ -148,8 +148,8 @@ def open(readonly):
e9bfca
     # Get a reference to the transfer service.
e9bfca
     transfers_service = system_service.image_transfers_service()
e9bfca
 
e9bfca
-    # Create a new image transfer.
e9bfca
-    host = find_host(connection)
e9bfca
+    # Create a new image transfer, using the local host is possible.
e9bfca
+    host = find_host(connection) if params['rhv_direct'] else None
e9bfca
     transfer = transfers_service.add(
e9bfca
         types.ImageTransfer(
e9bfca
             disk = types.Disk(id = disk.id),
e9bfca
-- 
e9bfca
2.17.1
e9bfca