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

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