mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-02 15:36:05 +00:00
Write the identify indicator where reading finds it
Reading prefers the chassis, writing looked only at the system.
This commit is contained in:
@@ -897,6 +897,21 @@ class Command(object):
|
||||
if not targurl:
|
||||
raise Exception("Unable to identify system url")
|
||||
targinfo = await self._do_web_request(targurl)
|
||||
if ('IndicatorLED' not in targinfo
|
||||
and 'LocationIndicatorActive' not in targinfo):
|
||||
# The indicator belongs to the chassis and may be described only
|
||||
# there, which is where reading looks too. A shared chassis is
|
||||
# somebody else's indicator, as in get_identify.
|
||||
for chassis in targinfo.get('Links', {}).get('Chassis', []):
|
||||
chassisinfo = await self._do_web_request(chassis['@odata.id'])
|
||||
if len(chassisinfo.get('Links', {}).get(
|
||||
'ComputerSystems', [])) > 1:
|
||||
continue
|
||||
if ('IndicatorLED' in chassisinfo
|
||||
or 'LocationIndicatorActive' in chassisinfo):
|
||||
targurl = chassis['@odata.id']
|
||||
targinfo = chassisinfo
|
||||
break
|
||||
if ('IndicatorLED' not in targinfo
|
||||
and 'LocationIndicatorActive' not in targinfo):
|
||||
# Reading already knows when there is no indicator to speak of, so
|
||||
|
||||
Reference in New Issue
Block a user