[PATCH skeleton v6] skeleton: fixed hard-coding of master OCC hwmon sysfs path for PowerCap object

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue May 10 17:20:49 AEST 2016


Currently master OCC hwmon sysfs path is hardcoded to '/sys/class/hwmon/hwmon3/'.
This make the '/org/openbmc/sensors/host/PowerCap' interface cannot work when
master OCC is initilized as hwmon device other than 'hwmon3'.

'usr_powercap' attribute should be searched when OCC is active.
When skeleton creates 'PowerCap' objects, OCC may not be active.
So do the search each time setting power cap. Raise an exception when
there is no 'user_powercap' attribute.

This would fix the issue: https://github.com/openbmc/skeleton/issues/42

Also raise an exception when setting power cap fails. The exception
will be returned to REST API caller. This would fix the issue:
https://github.com/openbmc/skeleton/issues/43

Signed-off-by: Yi Li <adamliyi at msn.com>

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/openbmc/skeleton/50)
<!-- Reviewable:end -->


https://github.com/openbmc/skeleton/pull/50

Yi Li (1):
  skeleton: fixed hard-coding of master OCC hwmon sysfs path for
    PowerCap object

 bin/Sensors.py         | 78 ++++++++++++++++++++++++++++++++++++++++++++------
 bin/sensor_manager2.py |  3 --
 2 files changed, 69 insertions(+), 12 deletions(-)

-- 
2.8.1




More information about the openbmc mailing list