From 5ddbb49982e117174e3c841ad9c421f1f825281a Mon Sep 17 00:00:00 2001 From: Tianhao He Date: Fri, 18 Nov 2016 20:53:12 -0800 Subject: [PATCH] Add user-agent header when connecting to vsphere --- pyVmomi/SoapAdapter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyVmomi/SoapAdapter.py b/pyVmomi/SoapAdapter.py index d919117..76b1841 100644 --- a/pyVmomi/SoapAdapter.py +++ b/pyVmomi/SoapAdapter.py @@ -1312,7 +1312,8 @@ class SoapStubAdapter(SoapStubAdapterBase): headers = {'Cookie' : self.cookie, 'SOAPAction' : self.versionId, - 'Content-Type': 'text/xml; charset={0}'.format(XML_ENCODING)} + 'Content-Type': 'text/xml; charset={0}'.format(XML_ENCODING), + 'User-Agent' : 'pyvmomi'} if self._acceptCompressedResponses: headers['Accept-Encoding'] = 'gzip, deflate' req = self.SerializeRequest(mo, info, args)