Skip to content

Conversation

baemyung
Copy link
Contributor

Refactor Managers with getValidManagerPath

This adds getValidManagerPath() to find the valid manager dbus path and
its service name. This can be used for manager GET and PATCH operations.

Tested:

  • GET /redfish/v1/Managers/bmc
  • PATCH /redfish/v1/Managers/ LocationIndicatorActive
  • Redfish Service Validator passes

Change-Id: Id46dd12be3050a2097364696a471b188b8167016

@baemyung
Copy link
Contributor Author

This will be rebased after #1352 is merged.

@baemyung
Copy link
Contributor Author

baemyung commented Aug 23, 2025

@baemyung baemyung force-pushed the 1120-refactor-get-valid-manager-path branch 6 times, most recently from f6fa2d2 to 16d83c7 Compare August 25, 2025 13:36
This adds getValidManagerPath() to find the valid manager dbus path and
its service name. This can be used for manager GET and PATCH operations.

Tested:
- GET /redfish/v1/Managers/bmc
- PATCH /redfish/v1/Managers/ LocationIndicatorActive
- Redfish Service Validator passes

Change-Id: Id46dd12be3050a2097364696a471b188b8167016
Signed-off-by: Myung Bae <[email protected]>
The current Oem SubRoute is calling unconditionally for GET or PATCH.
As the result, if there is an error before handleSubRoute, the result
may still contain "Oem" data even if the operation may fail.

For example, for GET,  Oem/OpenBmc parts are still present.

```
% curl -k -X GET https://${bmc}/redfish/v1/Managers/bmc
{
  "Oem": {
    "OpenBmc": {
      "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc",
      "@odata.type": "#OpenBMCManager.v1_0_0.Manager",
      "Certificates": {
        "@odata.id": "/redfish/v1/Managers/bmc/Truststore/Certificates"
      }
    }
  },
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The request failed due to an internal service error.  The service is still operational.",
        "MessageArgs": [],
        "MessageId": "Base.1.19.InternalError",
        "MessageSeverity": "Critical",
        "Resolution": "Resubmit the request.  If the problem persists, consider resetting the service."
      }
    ],
    "code": "Base.1.19.InternalError",
    "message": "The request failed due to an internal service error.  The service is still operational."
  }
}
```

This may be okay for GET, but PATCH may still cause the OemAction even
if the other part (e.g. valid dbus-path check) is failed.
For the proper handling OemSubRoute, it may need to occur inside
async-callback (which may check the valid dbus-path).

In this case, passing the original `req` to handleSubRoute
may need the copy of `req`. This can be avoid by creating `SubRoute`
structure before calling it.

Tested:
- Redfish Service Validator passes
- Manager GET/PATCH

Signed-off-by: Myung Bae <[email protected]>
This refactors handleManagerPatch to validate manager dbus path using
getValidManagerPath function. With it, setLocationIndicatorActive can
also be simplified.

Tested:
- PATCH /redfish/v1/Managers/ LocationIndicatorActive
- Redfish Service Validator passes

Change-Id: I5a2967ce707275f1ad7c3c933212fcda5fa086f4
Signed-off-by: Myung Bae <[email protected]>
@baemyung baemyung force-pushed the 1120-refactor-get-valid-manager-path branch from 16d83c7 to 551caf5 Compare August 25, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants