forked from openbmc/skeleton
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skeleton: fixed hard-coding of master OCC hwmon sysfs path for PowerC…
…ap object 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. Fixes: openbmc#42 Also raise an exception when setting power cap fails. The exception will be returned to REST API caller. Need to specify the exception name to trigger a '400' return code. Fixes: openbmc#43 Add code to validate input user powercap value. Changed the logic of "reading powercap" using PowerCap.getValue(). Previously PowerCap.getValue() returns current user set powercap value. Now PowerCap.getValue() returns actual system powercap reading from OCC. Signed-off-by: Yi Li <adamliyi@msn.com>
- Loading branch information
Showing
2 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters