From 6cfa823ea9cba4b83d2cdbdc7de28a3de866cc61 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 5 Jun 2015 11:00:25 -0400 Subject: [PATCH] Tolerate alternative return code for FRU size 202 means 'Cannot return number of request bytes', which is pretty on the nose for the scenario at hand. Include that in the conditions to reduce the request size. Thanks to Rafael Debarros for this. Change-Id: I833faf2559a93e468748a72db29e6967bc800207 --- pyghmi/ipmi/fru.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyghmi/ipmi/fru.py b/pyghmi/ipmi/fru.py index 0fe32aba..8feb33a1 100644 --- a/pyghmi/ipmi/fru.py +++ b/pyghmi/ipmi/fru.py @@ -160,7 +160,7 @@ class FRU(object): response = self.ipmicmd.raw_command( netfn=0xa, command=0x11, data=[fruid, offset & 0xff, offset >> 8, chunksize]) - if response['code'] == 201: + if response['code'] in (201, 202): # if it was too big, back off and try smaller # Try just over half to mitigate the chance of # one request becoming three rather than just two