Fixes #38914 - Use ETag-aware patch_if_match for Redfish operations#930
Conversation
9b48f9f to
1519582
Compare
|
Hi @ekohl , redfish_client 0.8.0 has now been officially released with ETag support included. Thank you as always for your review. |
Some Redfish implementations reject PATCH requests without If-Match. This change updates boot device operations to use patch_if_match, enabling ETag-based conditional PATCH when needed.
1519582 to
7990272
Compare
stejskalleos
left a comment
There was a problem hiding this comment.
🍏 LGTM
- Scope of introduced changes is clear and does what it should
- Well covered by the tests
My testing
This time, my testing abilities were limited to the redfishMockupServer.
curl --user admin:changeme \
-X PUT \
-H "Content-Type: application/json" \
-d '{}' \
"http://smart-proxy.local.lan/bmc/:redfish_host/chassis/config/bootdevice/pxe"
=>
{
"action": "bios",
"result": {
"device": "bios",
"reboot": null,
"persistent": null
}
}and logs from the redfish mockup server:
"GET /redfish/v1/Systems/RackServer-3 HTTP/1.1"
PATCH: Content: type=application/json and params={}
PATCH: Data: {'Boot': {'BootSourceOverrideTarget': 'BiosSetup', 'BootSourceOverrideEnabled': 'Once'}}
application/json
The overall result looks good, and looking at the coverage in the redfish_client PR, I can say we can merge, even without tests on a real setup.
I'll keep the PR open until Monday to give the community time to comment. If there are no objections on Monday, I will merge the PR.
The requested change has been addressed.
|
Thanks @spesnova717 |
|
Thanks @stejskalleos for the testing and for merging this! |
Summary
Some Redfish implementations reject PATCH requests without If-Match.
This change updates boot device operations to use
patch_if_match, enabling ETag-based conditional PATCH when needed.
Problem
Certain BMC implementations require the
If-Matchheaderwith ETag values for PATCH operations.
The previous implementation using
system.patchdid not include this header, causing operations to fail on some hardware.
Solution
Changed PATCH operations in
modules/bmc/redfish.rbto usepatch_if_match,which automatically includes the
If-Matchheader with the appropriate ETag value when available.