diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 1f4b03d3..510d13f0 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -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): diff --git a/pyghmi/ipmi/oem/lenovo/nextscale.py b/pyghmi/ipmi/oem/lenovo/nextscale.py index a8c53b02..c593cdf1 100644 --- a/pyghmi/ipmi/oem/lenovo/nextscale.py +++ b/pyghmi/ipmi/oem/lenovo/nextscale.py @@ -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: