Module: check_mk
Branch: master
Commit: 0e4aa746d5b4a699a2134ac563ea65e3945ee9df
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e4aa746d5b4a6…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Apr 10 08:24:02 2019 +0200
agent_vsphere: refactor for testing with tracefile (II)
Change-Id: I8e9be6d5abfcef26bc05af50d97cfe62da95c9cf
---
agents/special/agent_vsphere | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index 84d5097..3c4438f 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -994,11 +994,9 @@ class ESXConnection(object):
if self.system_info:
payload_params.update(self.system_info)
soapdata = put_in_envelope(payload)
- return soapdata % payload_params
-
- def query_server(self, payload, payload_params=None):
- soapdata = self.prepare_soapdata(payload, payload_params)
+ return soapdata % payload_params, payload_params
+ def send_soapdata(self, soapdata, payload_params):
self._init_headers(soapdata)
response_data = []
@@ -1036,6 +1034,10 @@ class ESXConnection(object):
return response, "".join(response_data)
+ def query_server(self, payload, payload_params=None):
+ soapdata, payload_params = self.prepare_soapdata(payload, payload_params)
+ return self.send_soapdata(soapdata, payload_params)
+
def _init_headers(self, soapdata):
self._server_handle.putrequest("POST", "/sdk")
self._server_handle.putheader("Content-Length", "%d" %
len(soapdata))