mirror of
https://opendev.org/x/pyghmi
synced 2025-01-14 19:57:47 +00:00
Fix get_health with a NextScale FPC
There was an oversimplified assumption in play. Provide a method to enumerate the generated names as well as the static names. Change-Id: I08dbaaafd7c607869d185f57bae0ea70ebf1084e
This commit is contained in:
parent
14fa128a18
commit
a01e705ab7
@ -299,7 +299,7 @@ class OEMHandler(generic.OEMHandler):
|
||||
|
||||
def get_sensor_data(self):
|
||||
if self.is_fpc:
|
||||
for name in nextscale.fpc_sensors:
|
||||
for name in nextscale.get_sensor_names():
|
||||
yield nextscale.get_sensor_reading(name, self.ipmicmd)
|
||||
|
||||
def get_sensor_descriptions(self):
|
||||
|
@ -68,6 +68,18 @@ fpc_sensors = {
|
||||
}
|
||||
|
||||
|
||||
def get_sensor_names():
|
||||
global fpc_sensors
|
||||
for name in fpc_sensors:
|
||||
sensor = fpc_sensors[name]
|
||||
if 'elements' in sensor:
|
||||
for elemidx in xrange(sensor['elements']):
|
||||
elemidx += 1
|
||||
yield '{0} {1}'.format(name, elemidx)
|
||||
else:
|
||||
yield name
|
||||
|
||||
|
||||
def get_sensor_descriptions():
|
||||
global fpc_sensors
|
||||
for name in fpc_sensors:
|
||||
|
Loading…
x
Reference in New Issue
Block a user