Fix Session delete to return 200
the tests on
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/43984 identified
that there are some that actually look at response codes, and expect
200. This would show up as failures that looked like:
Test SSL Connection :: This testcase is for testing the SSL connec... | [31mFAIL[0m |
Parent suite setup failed:
ValueError: The HTTP status code was not valid:
status: 204
valid_status_codes:
[0]: 200
This commit fixes the behavior change to move back to the old behavior,
and causes SessionService Delete to return 200 with a success message.
This commit changes this code back to 200, even though 204 is valid and
the test should pass for both, 200 with a success message more closely
follows Redfish.
Tested:
Code builds. Expect the above bump to test this behavior directly.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1d6bbfab867dc757c78f745119cfd9835ebbc505
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp
index 53ec7d0..bb7ad12 100644
--- a/redfish-core/lib/redfish_sessions.hpp
+++ b/redfish-core/lib/redfish_sessions.hpp
@@ -101,7 +101,7 @@
persistent_data::SessionStore::getInstance().removeSession(
session);
- asyncResp->res.result(boost::beast::http::status::no_content);
+ messages::success(asyncResp->res);
});
BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/")