summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorClaire Weinan <cweinan@google.com>2022-06-14 02:36:39 +0300
committerClaire Weinan <cweinan@google.com>2022-06-14 03:50:43 +0300
commitc7a6d66054deb891a224aac5c4ae0e66ddeb6769 (patch)
tree0141997237c46f227e8304b964b97d17c3c1a705 /src
parenta85afbe1960b015865db775c3e0a53df2a769f44 (diff)
downloadbmcweb-c7a6d66054deb891a224aac5c4ae0e66ddeb6769.tar.xz
LogService: Fix setUpRedfishRoute() for dumps
There's an inconsistency between how setUpRedfishRoute() is called for BMC dump vs. System dump. In requestRoutesSystemDumpEntry(), setUpRedfishRoute() is called within getDumpEntryById, while in requestRoutesBMCDumpEntry() setUpRedfishRoute() is called before getDumpEntryById() as well as within getDumpEntryById(). The inconsistency was introduced in https://gerrit.openbmc.org/c/openbmc/bmcweb/+/52393/20/redfish-core/lib/log_services.hpp and seems to be accidental. This change removes setUpRedfishRoute() from getDumpEntryById() and makes requestRoutesSystemDumpEntry() call setUpRedfishRoute() before calling getDumpEntryById(). In addition to fixing the inconsistency, this change prevents setUpRedfishRoute() from being called twice for BMC dump. Tested: After creating System dump entry, retrieved it successfully with ./curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1 Saw “setup redfish route” message in journalctl: bmcweb[19717]: (2022-06-13 16:42:52) [DEBUG "routing.hpp":1294] Matched rule '/redfish/v1/Systems/system/LogServices/Dump/Entries/<str>/' 2 / 4 bmcweb[19717]: (2022-06-13 16:42:52) [DEBUG "query.hpp":19] setup redfish route Received the expected error when adding a query parameter for a non-collection resource, which indicates setUpRedfishRoute() had been called: ./curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1?\$skip=1 { "@odata.id": "/redfish/v1/Systems/system/LogServices/Dump/Entries/1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "AdditionalDataSizeBytes": 0, "AdditionalDataURI": "/redfish/v1/Systems/system/LogServices/Dump/Entries/1/attachment", "Created": "1970-01-01T00:27:35.135000+00:00", "DiagnosticDataType": "OEM", "EntryType": "Event", "Id": "1", "Name": "System Dump Entry", "OEMDiagnosticDataType": "System", "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "Querying is not supported on the requested resource.", "MessageArgs": [], "MessageId": "Base.1.11.0.QueryNotSupportedOnResource", "MessageSeverity": "Warning", "Resolution": "Remove the query parameters and resubmit the request if the operation failed." } ], "code": "Base.1.11.0.QueryNotSupportedOnResource", "message": "Querying is not supported on the requested resource." } } Repeated the same testing for a BMC dump entry. Signed-off-by: Claire Weinan <cweinan@google.com> Change-Id: I41ea93bfc6971a775241a368491e4615295cc4db
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions