mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 19:10:10 +00:00
Tolerate different SR635/SR655 response
Some SR635/SR655 behave differently. Adjust by adapting as possible, but never making an assumption about data being present.
This commit is contained in:
parent
b4f9bb78ae
commit
8df15b3a54
@ -603,8 +603,13 @@ def scan(srvtypes=_slp_services, addresses=None, localonly=False):
|
||||
curratt = currinf.get('attributes', {})
|
||||
if curratt.get('System-Manufacturing', [None])[0] == 'Lenovo' and curratt.get('type', [None])[0] == 'LenovoThinkServer':
|
||||
currinf['services'] = ['service:lenovo-tsm']
|
||||
curratt['enclosure-serial-number'] = curratt['Product-Serial']
|
||||
curratt['enclosure-machinetype-model'] = curratt['Machine-Type']
|
||||
serialnumber = curratt.get('Product-Serial', curratt.get('SerialNumber', None))
|
||||
if serialnumber:
|
||||
curratt['enclosure-serial-number'] = serialnumber
|
||||
mtm = curratt.get('Machine-Type', curratt.get('Product-Name', None))
|
||||
if mtm:
|
||||
mtm[0] = mtm[0].rstrip()
|
||||
curratt['enclosure-machinetype-model'] = mtm
|
||||
else:
|
||||
continue
|
||||
del rsps[id]['payload']
|
||||
|
Loading…
Reference in New Issue
Block a user