mirror of
https://opendev.org/x/pyghmi
synced 2025-01-14 03:37:47 +00:00
Cope with empty agentless fields
Some adapters present empty agentless fields. For such scenarios, skip enumerating the key. This avoids date parsing errors, among other things. Change-Id: I3df5f1dd320aa2e915760b6d2cae0f04ec5e09c6
This commit is contained in:
parent
7b59b7759b
commit
3fe1b5f60f
@ -123,8 +123,11 @@ def fetch_adapter_firmware(ipmicmd, certverify):
|
||||
continue
|
||||
donenames.add(fname)
|
||||
bdata = {}
|
||||
bdata['version'] = firm['versionStr']
|
||||
if 'releaseDate' in firm and firm['releaseDate'] != 'N/A':
|
||||
if 'versionStr' in firm and firm['versionStr']:
|
||||
bdata['version'] = firm['versionStr']
|
||||
if ('releaseDate' in firm and
|
||||
firm['releaseDate'] and
|
||||
firm['releaseDate'] != 'N/A'):
|
||||
bdata['date'] = datetime.strptime(firm['releaseDate'],
|
||||
'%m/%d/%Y')
|
||||
yield ('{0} {1}'.format(aname, fname), bdata)
|
||||
|
Loading…
x
Reference in New Issue
Block a user