Bug #10116
closedBMC is not able to use parameters passed in through body
Description
This have been broken since initial release of BMC code, the problem appears that because Sinatra does not parse the body of the request into the params object, there is no way for the user to pass in additional options to choose a provider. The unit tests were setup to pass this in with the params so the problem has been masked for quite a while. Additional, if users have been using a default provider they would not have noticed an issue either. This was really just an issue with my perception of how Sinatra worked.
This issue was found by using curl and passing in data through the body of the request and the smart-proxy was not getting access to these additional options.
Example Call
curl -vks --header "Content-Type: application/json" -d '{"bmc_provider":"freeipmi", "options":{"driver":"lan20"}}' 'http://127.0.0.1:8443/bmc/192.168.1.21/chassis/power/off' -X PUT -u admin:password * Hostname was NOT found in DNS cache * Trying 127.0.0.1... * Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0) * Server auth using Basic with user 'admin' > PUT http://127.0.0.1:8443/bmc/192.168.1.21/chassis/power/off HTTP/1.1 > Authorization: Basic YWRtaW46cGFzc3dvcmQ= > User-Agent: curl/7.37.1 > Host: 127.0.0.1:8443 > Accept: */* > Proxy-Connection: Keep-Alive > Content-Type: application/json > Content-Length: 57 > * upload completely sent off: 57 out of 57 bytes < HTTP/1.1 200 OK < Content-Type: text/html;charset=utf-8 < Content-Length: 46 < X-Xss-Protection: 1; mode=block < X-Content-Type-Options: nosniff < X-Frame-Options: SAMEORIGIN * Server WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13) OpenSSL/1.0.1j is not blacklisted < Server: WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13) OpenSSL/1.0.1j < Date: Fri, 10 Apr 2015 21:10:41 GMT < Proxy-Connection: Keep-alive < * Connection #0 to host 127.0.0.1 left intact {"action":"off","result":"192.168.1.21: ok\n"}
Updated by The Foreman Bot over 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/smart-proxy/pull/275 added
- Pull request deleted (
)
Updated by Dominic Cleal over 9 years ago
- Related to Bug #7543: allow additional rubyipmi connection options to be passed through added
Updated by Corey Osman over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 6ebc1ccd9e993d377eba9052470380d29a29abe5.
Updated by Dominic Cleal over 9 years ago
- Translation missing: en.field_release set to 35