From fcdfdd763c5efbc079b7872173a20aa9cf48273c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 26 Jul 2017 11:36:32 -0400 Subject: [PATCH] Fix concurrent firmware updates If another instance deletes the form, it's ok. Ignore the exception and continue on. Change-Id: I3c92e5c657d6b16daa70f26dd450e3b9c6e55a11 --- pyghmi/ipmi/oem/lenovo/imm.py | 2 +- pyghmi/util/webclient.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index c3ed07e4..146d4d6e 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -563,7 +563,7 @@ class XCCClient(IMMClient): raise Exception('Unexpected response: ' + repr(rsp)) progress({'phase': 'upload', 'progress': 100.0}) - ipmisession.Session.pause(2) + ipmisession.Session.pause(3) # aggressive timing can cause the next call to occasionally # return 25 and fail self._refresh_token() diff --git a/pyghmi/util/webclient.py b/pyghmi/util/webclient.py index 9bda6917..df0a2fe8 100644 --- a/pyghmi/util/webclient.py +++ b/pyghmi/util/webclient.py @@ -128,7 +128,10 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): # peer updates in progress should already have pointers, # subsequent transactions will cause memory to needlessly double, # but easiest way to keep memory relatively low - del uploadforms[filename] + try: + del uploadforms[filename] + except KeyError: # something could have already deleted it + pass if rsp.status != 200: raise Exception('Unexpected response in file upload: ' + rsp.read())