summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0005-Set-Inserted-redfish-property-for-not-inserted-resou.patch
blob: 3d80aeb2057f8caa95cdb344c2827e9c80f401c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 89ca38dbc3433b3b734a20068e599809f3bd7b90 Mon Sep 17 00:00:00 2001
From: Karol Wachowski <karol.wachowski@intel.com>
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 <karol.wachowski@intel.com>
---
 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 3e28164..4c475b7 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -96,6 +96,7 @@ static void
         BMCWEB_LOG_DEBUG << "Value Active not found";
         return;
     }
+    aResp->res.jsonValue["Inserted"] = *activeValue;
 
     const std::string* endpointIdValue =
         std::get_if<std::string>(&endpointIdProperty->second);
@@ -107,7 +108,6 @@ static void
             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";
@@ -138,7 +138,6 @@ static void
                         }
 
                         aResp->res.jsonValue["Image"] = *imageUrlValue;
-                        aResp->res.jsonValue["Inserted"] = *activeValue;
                         aResp->res.jsonValue["TransferProtocolType"] =
                             getTransferProtocolTypeFromUri(*imageUrlValue);
 
-- 
2.17.1