2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 12:17:44 +00:00

Break out of FRU read if zero data returned

If a BMC returns 0 data, then assume end of data has been
reached.  Not all implementations accurately advertise FRU
size, so this is a way to detect and break out.

Change-Id: I03d0393563f8527e16830098b649ae940ee7ee9e
This commit is contained in:
Jarrod Johnson 2015-05-07 10:30:52 -04:00
parent 8c8ce504c1
commit c28ff05b1e

View File

@ -172,6 +172,8 @@ class FRU(object):
raise iexc.IpmiException(response['error'], response['code'])
self.rawfru.extend(response['data'][1:])
offset += response['data'][0]
if response['data'][0] == 0:
break
if offset + chunksize > frusize:
chunksize = frusize - offset