diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index d2b2d746..5a9dc25d 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -622,7 +622,7 @@ class XCCClient(IMMClient): if rsv['return'] != 0: raise Exception('Unexpected return to reservation: ' + repr(rsv)) xid = random.randint(0, 1000000000) - uploadthread = FileUploader(self.wc.dupe(), + uploadthread = FileUploader(self.wc, '/upload?X-Progress-ID={0}'.format(xid), filename, data) uploadthread.start() diff --git a/pyghmi/util/webclient.py b/pyghmi/util/webclient.py index 4a5bb009..fa42e0b7 100644 --- a/pyghmi/util/webclient.py +++ b/pyghmi/util/webclient.py @@ -75,8 +75,8 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): self.cert_reqs = ssl.CERT_NONE # verification will be done ssh style.. if clone: self._certverify = clone._certverify - self.cookies = clone.cookies.copy() - self.stdheaders = clone.stdheaders.copy() + self.cookies = clone.cookies + self.stdheaders = clone.stdheaders else: self._certverify = verifycallback self.cookies = {} @@ -113,11 +113,12 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): return rsp def grab_json_response(self, url, data=None, referer=None): + webclient = self.dupe() if data: - self.request('POST', url, data, referer=referer) + webclient.request('POST', url, data, referer=referer) else: - self.request('GET', url, referer=referer) - rsp = self.getresponse() + webclient.request('GET', url, referer=referer) + rsp = webclient.getresponse() if rsp.status == 200: return json.loads(rsp.read()) rsp.read() @@ -138,8 +139,9 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): form = get_upload_form(filename, data, formname, otherfields) ulheaders = self.stdheaders.copy() ulheaders['Content-Type'] = 'multipart/form-data; boundary=' + BND - self.request('POST', url, form, ulheaders) - rsp = self.getresponse() + webclient = self.dupe() + webclient.request('POST', url, form, ulheaders) + rsp = webclient.getresponse() # peer updates in progress should already have pointers, # subsequent transactions will cause memory to needlessly double, # but easiest way to keep memory relatively low