Comments (7)
Please see PR: #50
An exception will be returned when setting the power cap value out of range:
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d "{"data": [ 1900 ]}" https://9.3.23.24/org/openbmc/sensors/hot/PowerCap/action/setValue
{
"data": {
"description": "Internal Server Error",
"exception": "DBusException('Set PowerCap error: check value range',)",
"traceback": [
"Traceback (most recent call last):",
" File "/usr/lib/python2.7/site-packages/bottle.py", line 862, in _handle",
" return route.call(*_args)",
" File "/usr/lib/python2.7/site-packages/bottle.py", line 1734, in wrapper",
" rv = callback(_a, **ka)",
" File "/usr/sbin/obmc-rest", line 569, in call",
" return self.callback(_a, *_kw)",
" File "/usr/sbin/obmc-rest", line 657, in wrap",
" resp = { 'data': callback(_a, *_kw) }",
" File "/usr/sbin/obmc-rest", line 622, in wrap",
" return callback(_a, *_kw)",
" File "/usr/sbin/obmc-rest", line 646, in wrap",
" return callback(_a, kw)",
" File "/usr/sbin/obmc-rest", line 79, in call",
" return getattr(self, 'do' + request.method.lower())(_kw)",
" File "/usr/sbin/obmc-rest", line 240, in do_post",
" return request.route_data'method'",
" File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 145, in call",
" *_keywords)",
" File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking",
" message, timeout)",
"DBusException: org.freedesktop.DBus.Python.dbus.exceptions.DBusException: Set PowerCap error: check value range"
]
},
"message": "500 Internal Server Error",
"status": "error"
}
from skeleton.
500 internal error is not really accepted, we should through 4xx series error. You can refer https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error to understand more about errors.
from skeleton.
Thanks Manjunath for reminding. I need to check with Brad.
from skeleton.
Updated the PR.
Here is the new return code when setting invalid power cap value:
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d "{"data": [ 2000 ]}" https://9.3.23.24/org/openbmc/sensors/host/PowerCap/action/setValue
{
"data": {
"description": "org.freedesktop.DBus.Error.InvalidArgs: Set PowerCap error: check value range"
},
"message": "400 Bad Request",
"status": "error"
}
from skeleton.
@mkumatag , I've setup the barreley 9.3.23.24. Could you please verify issue #42, and issue #43.
I have replaced the two files on that server with my fix.
/usr/sbin/Sensors.py and /usr/sbin/sensor_manager2.py
Thanks,
from skeleton.
I just verified the tests on that machine for issue #43 and working fine.
Test Occ Powercap :: This suite is for testing OCC: Power capping ... | PASS |
6 critical tests, 6 passed, 0 failed
6 tests total, 6 passed, 0 failed
Output: /home/manjunath/git/openbmc-automation/output.xml
Log: /home/manjunath/git/openbmc-automation/log.html
Report: /home/manjunath/git/openbmc-automation/report.html
______________________________________________________________________________________________ summary ______________________________________________________________________________________________
custom: commands succeeded
congratulations :)
[manjunath@oc1275007250 openbmc-automation]$
from skeleton.
Why this issue has been closed? is code already merged?
from skeleton.
Related Issues (20)
- Change pgood polling to interrupt driven
- Handle Host Checkstop during BMC reboot
- Obmcutil getsensors can not work HOT 2
- Set Value by dbus is not work. HOT 2
- BIOS version doesn't show via openBMC REST HOT 1
- host_checkstop_obj.c fails to build with gcc 5 HOT 1
- RESTORE_LAST_STATE does not work correctly. HOT 1
- Host watchdog timeout when RMC communicates with BMC continually HOT 4
- [skeleton/openbmc-v1.0-stable] Fail sync MAC from io_board fru if using random MAC address by default HOT 3
- Updating BIOS via REST API wipes out the Boot options (NVRam) HOT 1
- [security] overwrite any file on the bmc with updateViaTftp HOT 5
- gpio_button.irq_inited usage?
- Convert obmcutil from python to bash HOT 7
- palmetto chassis_powerControl HOT 1
- maintainer needed HOT 2
- scan-build: includes/gpio.c:197,9 Value stored to 'id' during its initialization is never read
- scan-build: includes/gpio.c:179,2 Function call argument is an uninitialized value
- scan-build: objects/pflash/libflash/libflash.c:571,2 Undefined or garbage value returned to caller HOT 6
- scan-build: objects/pcie_slot_present_obj.c:152,15 The left operand of '==' is a garbage value
- PreTag openbmc/skeleton#43 - Set Less Than Minimum PowerCAP HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skeleton.