summaryrefslogtreecommitdiff
path: root/redfish-core/lib/systems.hpp
diff options
context:
space:
mode:
authorAli Ahmed <ama213000@gmail.com>2021-09-16 05:02:57 +0300
committerGunnar Mills <gmills@us.ibm.com>2021-09-22 17:25:58 +0300
commitac7e1e0baf7fd0439b0352954d354f5f1a51e439 (patch)
tree907748915f3ad5f5843974daa0fb4b72490871fd /redfish-core/lib/systems.hpp
parenta3e65892add97ce68816c1544c0aa21591239fc7 (diff)
downloadbmcweb-ac7e1e0baf7fd0439b0352954d354f5f1a51e439.tar.xz
Move TPMRequiredToBoot under Boot for PATCH call
TrustedModuleRequiredToBoot is a sub-parameter of the 'Boot' parameter. Edits the patch code to make sure the patch happens under '{"Boot":{"TrustedModuleRequiredToBoot": false}}', instead of current: '{"TrustedModuleRequiredToBoot":false}'. Testing: 1) Curl testing: curl -k -H "X-Auth-Token: $token" -X PATCH \ -d '{"Boot":{"TrustedModuleRequiredToBoot": true}}' \ https://${bmc}/redfish/v1/Systems/system curl -k -H "X-Auth-Token: $token" \ https://${bmc}/redfish/v1/Systems/system { ... "Boot": { "AutomaticRetryAttempts": 3, "AutomaticRetryConfig": "Disabled", "AutomaticRetryConfig@Redfish.AllowableValues": [ "Disabled", "RetryAttempts" ], "BootSourceOverrideEnabled": "Disabled", "BootSourceOverrideTarget": "BiosSetup", "BootSourceOverrideTarget@Redfish.AllowableValues": [ "None", "Pxe", "Hdd", "Cd", "Diags", "BiosSetup", "Usb" ], "TrustedModuleRequiredToBoot": "Required" }, ... } Signed-off-by: Ali Ahmed <ama213000@gmail.com> Change-Id: I70b26a8e3c7282fa628dcc149d1328a8dc9f0b8b
Diffstat (limited to 'redfish-core/lib/systems.hpp')
-rw-r--r--redfish-core/lib/systems.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 680a0ee7db..3e27241a7e 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -2778,15 +2778,12 @@ inline void requestRoutesSystems(App& app)
std::optional<std::string> assetTag;
std::optional<std::string> powerRestorePolicy;
std::optional<std::string> powerMode;
- std::optional<bool> trustedModuleRequiredToBoot;
if (!json_util::readJson(
req, asyncResp->res, "IndicatorLED", indicatorLed,
"LocationIndicatorActive", locationIndicatorActive,
"Boot", bootProps, "WatchdogTimer", wdtTimerProps,
"PowerRestorePolicy", powerRestorePolicy, "AssetTag",
- assetTag, "PowerMode", powerMode,
- "TrustedModuleRequiredToBoot",
- trustedModuleRequiredToBoot))
+ assetTag, "PowerMode", powerMode))
{
return;
}
@@ -2818,13 +2815,16 @@ inline void requestRoutesSystems(App& app)
std::optional<std::string> bootType;
std::optional<std::string> bootEnable;
std::optional<std::string> automaticRetryConfig;
+ std::optional<bool> trustedModuleRequiredToBoot;
if (!json_util::readJson(
*bootProps, asyncResp->res,
"BootSourceOverrideTarget", bootSource,
"BootSourceOverrideMode", bootType,
"BootSourceOverrideEnabled", bootEnable,
- "AutomaticRetryConfig", automaticRetryConfig))
+ "AutomaticRetryConfig", automaticRetryConfig,
+ "TrustedModuleRequiredToBoot",
+ trustedModuleRequiredToBoot))
{
return;
}
@@ -2838,6 +2838,12 @@ inline void requestRoutesSystems(App& app)
{
setAutomaticRetry(asyncResp, *automaticRetryConfig);
}
+
+ if (trustedModuleRequiredToBoot)
+ {
+ setTrustedModuleRequiredToBoot(
+ asyncResp, *trustedModuleRequiredToBoot);
+ }
}
if (locationIndicatorActive)
@@ -2866,12 +2872,6 @@ inline void requestRoutesSystems(App& app)
{
setPowerMode(asyncResp, *powerMode);
}
-
- if (trustedModuleRequiredToBoot)
- {
- setTrustedModuleRequiredToBoot(
- asyncResp, *trustedModuleRequiredToBoot);
- }
});
}