diff options
author | Jiaqing Zhao <jiaqing.zhao@intel.com> | 2022-08-05 11:21:51 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-09-06 17:47:10 +0300 |
commit | d8a5d5d8e07f6dec97ed0cbc84052656165f6172 (patch) | |
tree | 39e7630e6017f77dbaca8e7ef8a3b9d078abc2be /redfish-core/lib/account_service.hpp | |
parent | 3e7ab70817a6e49684c7c01ec0f2d67630f36559 (diff) | |
download | bmcweb-d8a5d5d8e07f6dec97ed0cbc84052656165f6172.tar.xz |
Update content of ResourceNotFound/ResourceAlreadyExists message
According to Redfish Base Message Registry definition [1], the first
argument of ResourceNotFound and ResourceAlreadyExists is the schema
name of the resource. This patch changes the first argument to non-
versioned schema name treewide.
Tested:
Verified the error message matches the definition, and Redfish Service
Validator passed.
[1] https://redfish.dmtf.org/registries/Base.1.13.0.json
Change-Id: Ib5cd853578ef0bffda1184d10827241e94faaf68
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
Diffstat (limited to 'redfish-core/lib/account_service.hpp')
-rw-r--r-- | redfish-core/lib/account_service.hpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp index d7c70c1cb1..b6316ef915 100644 --- a/redfish-core/lib/account_service.hpp +++ b/redfish-core/lib/account_service.hpp @@ -123,15 +123,13 @@ inline void userErrorMessageHandler( if (strcmp(errorMessage, "xyz.openbmc_project.User.Common.Error.UserNameExists") == 0) { - messages::resourceAlreadyExists(asyncResp->res, - "#ManagerAccount.v1_4_0.ManagerAccount", + messages::resourceAlreadyExists(asyncResp->res, "ManagerAccount", "UserName", newUser); } else if (strcmp(errorMessage, "xyz.openbmc_project.User.Common.Error." "UserNameDoesNotExist") == 0) { - messages::resourceNotFound( - asyncResp->res, "#ManagerAccount.v1_4_0.ManagerAccount", username); + messages::resourceNotFound(asyncResp->res, "ManagerAccount", username); } else if ((strcmp(errorMessage, "xyz.openbmc_project.Common.Error.InvalidArgument") == @@ -1123,8 +1121,7 @@ inline void updateUserProperties(std::shared_ptr<bmcweb::AsyncResp> asyncResp, asyncResp{std::move(asyncResp)}](int rc) { if (rc <= 0) { - messages::resourceNotFound(asyncResp->res, - "#ManagerAccount.v1_4_0.ManagerAccount", + messages::resourceNotFound(asyncResp->res, "ManagerAccount", username); return; } @@ -1135,9 +1132,8 @@ inline void updateUserProperties(std::shared_ptr<bmcweb::AsyncResp> asyncResp, if (retval == PAM_USER_UNKNOWN) { - messages::resourceNotFound( - asyncResp->res, "#ManagerAccount.v1_4_0.ManagerAccount", - username); + messages::resourceNotFound(asyncResp->res, "ManagerAccount", + username); } else if (retval == PAM_AUTHTOK_ERR) { @@ -1674,8 +1670,7 @@ inline void handleAccountHead(app, req, asyncResp, accountName); #ifdef BMCWEB_INSECURE_DISABLE_AUTHENTICATION // If authentication is disabled, there are no user accounts - messages::resourceNotFound( - asyncResp->res, "#ManagerAccount.v1_4_0.ManagerAccount", accountName); + messages::resourceNotFound(asyncResp->res, "ManagerAccount", accountName); return; #endif // BMCWEB_INSECURE_DISABLE_AUTHENTICATION @@ -1833,8 +1828,7 @@ inline void #ifdef BMCWEB_INSECURE_DISABLE_AUTHENTICATION // If authentication is disabled, there are no user accounts - messages::resourceNotFound( - asyncResp->res, "#ManagerAccount.v1_4_0.ManagerAccount", username); + messages::resourceNotFound(asyncResp->res, "ManagerAccount", username); return; #endif // BMCWEB_INSECURE_DISABLE_AUTHENTICATION @@ -1846,8 +1840,7 @@ inline void [asyncResp, username](const boost::system::error_code ec) { if (ec) { - messages::resourceNotFound(asyncResp->res, - "#ManagerAccount.v1_4_0.ManagerAccount", + messages::resourceNotFound(asyncResp->res, "ManagerAccount", username); return; } @@ -1869,8 +1862,7 @@ inline void } #ifdef BMCWEB_INSECURE_DISABLE_AUTHENTICATION // If authentication is disabled, there are no user accounts - messages::resourceNotFound( - asyncResp->res, "#ManagerAccount.v1_4_0.ManagerAccount", username); + messages::resourceNotFound(asyncResp->res, "ManagerAccount", username); return; #endif // BMCWEB_INSECURE_DISABLE_AUTHENTICATION |