[Redfish] Fix incorrect mapping of dbus and Redfish API strings for BootSource
- "Cd" should be mapped to "xyz.openbmc_project.Control.Boot.Source.Sources.DVD"
- Adding mapping "Usb" to "xyz.openbmc_project.Control.Boot.Source.Sources.Removable"
Tested:
PATCH /redfish/v1/Systems/system HTTP/1.1
{
"Boot": {
"BootSourceOverrideTarget": "Cd" (or "Usb")
}
}
Response:
{
"@Message.ExtendedInfo": [
{
"@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message",
"Message": "Successfully Completed Request",
"MessageArgs": [],
"MessageId": "Base.1.4.0.Success",
"Resolution": "None",
"Severity": "OK"
}
]
}
GET /redfish/v1/Systems/system HTTP/1.1
Response:
...
Boot:
{
...
"BootSourceOverrideTarget": "Cd", (or "Usb")
...
}
...
Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com>
Change-Id: Ib5f69fe93d45b4012c089bd48e484ef978a4e57a
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 8019d8c..a76f2c4 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -468,7 +468,7 @@
return "Hdd";
}
else if (dbusSource ==
- "xyz.openbmc_project.Control.Boot.Source.Sources.ExternalMedia")
+ "xyz.openbmc_project.Control.Boot.Source.Sources.DVD")
{
return "Cd";
}
@@ -477,6 +477,11 @@
{
return "Pxe";
}
+ else if (dbusSource ==
+ "xyz.openbmc_project.Control.Boot.Source.Sources.Removable")
+ {
+ return "Usb";
+ }
else
{
return "";
@@ -531,12 +536,16 @@
}
else if (rfSource == "Cd")
{
- return "xyz.openbmc_project.Control.Boot.Source.Sources.ExternalMedia";
+ return "xyz.openbmc_project.Control.Boot.Source.Sources.DVD";
}
else if (rfSource == "Pxe")
{
return "xyz.openbmc_project.Control.Boot.Source.Sources.Network";
}
+ else if (rfSource == "Usb")
+ {
+ return "xyz.openbmc_project.Control.Boot.Source.Sources.Removable";
+ }
else
{
return "";