From dab4adbf211b6867f86fcf6080b34a0e41f6f4a1 Mon Sep 17 00:00:00 2001 From: Karol Wachowski Date: Tue, 23 Feb 2021 15:53:16 +0000 Subject: [PATCH] Set Inserted redfish property for not inserted resources Tested: Verified that Inserted property is returned and set to "false" for not inserted media. Signed-off-by: Karol Wachowski --- redfish-core/lib/virtual_media.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp index 188248a..f477f63 100644 --- a/redfish-core/lib/virtual_media.hpp +++ b/redfish-core/lib/virtual_media.hpp @@ -95,6 +95,7 @@ static void vmParseInterfaceObject(const DbusInterfaceType& interface, BMCWEB_LOG_DEBUG << "Value Active not found"; return; } + aResp->res.jsonValue["Inserted"] = *activeValue; const std::string* endpointIdValue = std::get_if(&endpointIdProperty->second); @@ -106,7 +107,6 @@ static void vmParseInterfaceObject(const DbusInterfaceType& interface, aResp->res.jsonValue["Oem"]["OpenBMC"]["WebSocketEndpoint"] = *endpointIdValue; aResp->res.jsonValue["TransferProtocolType"] = "OEM"; - aResp->res.jsonValue["Inserted"] = *activeValue; if (*activeValue == true) { aResp->res.jsonValue["ConnectedVia"] = "Applet"; @@ -137,7 +137,6 @@ static void vmParseInterfaceObject(const DbusInterfaceType& interface, } aResp->res.jsonValue["Image"] = *imageUrlValue; - aResp->res.jsonValue["Inserted"] = *activeValue; aResp->res.jsonValue["TransferProtocolType"] = getTransferProtocolTypeFromUri(*imageUrlValue);