From c157dbe55ab127de3ef307324157d6c840abff4a Mon Sep 17 00:00:00 2001
From: Matthew Jones <mat@matburt.net>
Date: Sun, 13 Dec 2015 01:13:47 -0500
Subject: [PATCH] Fix up vsphere_copy after open_url change

* Remove leading module parameter on open_url call as it's no longer used
  by module_utils.urls.open_url
* Force basic auth otherwise vsphere will just return a 401
---
 cloud/vmware/vsphere_copy.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cloud/vmware/vsphere_copy.py b/cloud/vmware/vsphere_copy.py
index 2f3928575f2..77f147f17a8 100644
--- a/cloud/vmware/vsphere_copy.py
+++ b/cloud/vmware/vsphere_copy.py
@@ -137,8 +137,9 @@ def main():
     }
 
     try:
-        r = open_url(module, url, data=data, headers=headers, method='PUT',
-                url_username=login, url_password=password, validate_certs=validate_certs)
+        r = open_url(url, data=data, headers=headers, method='PUT',
+                url_username=login, url_password=password, validate_certs=validate_certs,
+                force_basic_auth=True)
     except socket.error, e:
         if isinstance(e.args, tuple) and e[0] == errno.ECONNRESET:
             # VSphere resets connection if the file is in use and cannot be replaced