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

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