summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeccabroek <beccabroek@gmail.com>2019-03-05 14:35:15 -0600
committerbeccabroek <beccabroek@gmail.com>2019-03-05 14:41:50 -0600
commitfc5afcf941d24a9049b61e715596ee87828a6c7d (patch)
tree71520e3064bd5c63b4eead0d18bff611efe475a6
parentbe12c7291914b8a6dd7d6e78f1a500708b0f20f9 (diff)
downloadbmcweb-fc5afcf941d24a9049b61e715596ee87828a6c7d.tar.gz
bmcweb-fc5afcf941d24a9049b61e715596ee87828a6c7d.zip
Redfish remove buildDate property from system
BuildDate does not exist in the Redfish ComputerSystem schema. Checks for the appropriate properties for system and adds them, rather than adding all properties returned. Tested: Verified /redfish/v1/Systems/system/ returns the correct properties on a Witherspoon system, and buildDate is no longer returned. Change-Id: I83e8f637b17868eda810cbe342d1569d534a6d1b Signed-off-by: beccabroek <beccabroek@gmail.com>
-rw-r--r--redfish-core/lib/systems.hpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 0b47c09..5e8b9a5 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -256,15 +256,22 @@ void getComputerSystem(std::shared_ptr<AsyncResp> aResp)
VariantType>
&property : propertiesList)
{
- const std::string *value =
- sdbusplus::message::variant_ns::
- get_if<std::string>(
- &property.second);
- if (value != nullptr)
+ const std::string &propertyName =
+ property.first;
+ if ((propertyName == "PartNumber") ||
+ (propertyName == "SerialNumber") ||
+ (propertyName == "Manufacturer") ||
+ (propertyName == "Model"))
{
- aResp->res
- .jsonValue[property.first] =
- *value;
+ const std::string *value =
+ std::get_if<std::string>(
+ &property.second);
+ if (value != nullptr)
+ {
+ aResp->res
+ .jsonValue[propertyName] =
+ *value;
+ }
}
}
aResp->res.jsonValue["Name"] = "system";
OpenPOWER on IntegriCloud