summaryrefslogtreecommitdiff
path: root/redfish-core/lib
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2022-10-19 05:35:36 +0300
committerEd Tanous <ed@tanous.net>2022-10-19 06:31:27 +0300
commit532d769725d346d5339387016ce14d75d41ee3b2 (patch)
tree25f4519c855665ff363be7fcf3e3d5eacac3308d /redfish-core/lib
parent0ad63df8aa8ab60f74395794d8ffce64c82ee031 (diff)
downloadbmcweb-532d769725d346d5339387016ce14d75d41ee3b2.tar.xz
Revert "NetworkProtocol: Support NetworkSuppliedServers property"
This reverts commit 525fc07224884d3640e5c4a1b6a551aee024f7bd. As discussed in discord, https://gerrit.openbmc.org/c/openbmc/openbmc/+/57931 is a legit fail. [1] https://discord.com/channels/775381525260664832/776550056391606352/1030497797121777768 The validator is failing due to: ERROR - NetworkSuppliedServers not defined in Complex NTPManagerNetworkProtocol.v1_2_0.NTPProtocol (check version, spelling and casing) Since the bmcweb bump merged, seeing validator fails in openbmc/openbmc. Revert, get the validator passing again, will open an issue with redfish since this looks like an issue with the schema itself. Tested: None. Change-Id: Ie8046c93eaf2f69c71eb5162dacb961032f9366c Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'redfish-core/lib')
-rw-r--r--redfish-core/lib/network_protocol.hpp32
1 files changed, 7 insertions, 25 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index de81e5ca0e..f99cfd3627 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -46,8 +46,7 @@ static constexpr std::array<std::pair<const char*, const char*>, 3>
inline void extractNTPServersAndDomainNamesData(
const dbus::utility::ManagedObjectType& dbusData,
- std::vector<std::string>& ntpData, std::vector<std::string>& dynamicNtpData,
- std::vector<std::string>& dnData)
+ std::vector<std::string>& ntpData, std::vector<std::string>& dnData)
{
for (const auto& obj : dbusData)
{
@@ -61,7 +60,7 @@ inline void extractNTPServersAndDomainNamesData(
for (const auto& propertyPair : ifacePair.second)
{
- if (propertyPair.first == "StaticNTPServers")
+ if (propertyPair.first == "NTPServers")
{
const std::vector<std::string>* ntpServers =
std::get_if<std::vector<std::string>>(
@@ -71,17 +70,6 @@ inline void extractNTPServersAndDomainNamesData(
ntpData = *ntpServers;
}
}
- else if (propertyPair.first == "NTPServers")
- {
- const std::vector<std::string>* dynamicNtpServers =
- std::get_if<std::vector<std::string>>(
- &propertyPair.second);
- if (dynamicNtpServers != nullptr)
- {
- dynamicNtpData = *dynamicNtpServers;
- }
- }
-
else if (propertyPair.first == "DomainName")
{
const std::vector<std::string>* domainNames =
@@ -106,19 +94,17 @@ void getEthernetIfaceData(CallbackFunc&& callback)
const boost::system::error_code errorCode,
const dbus::utility::ManagedObjectType& dbusData) {
std::vector<std::string> ntpServers;
- std::vector<std::string> dynamicNtpServers;
std::vector<std::string> domainNames;
if (errorCode)
{
- callback(false, ntpServers, dynamicNtpServers, domainNames);
+ callback(false, ntpServers, domainNames);
return;
}
- extractNTPServersAndDomainNamesData(dbusData, ntpServers,
- dynamicNtpServers, domainNames);
+ extractNTPServersAndDomainNamesData(dbusData, ntpServers, domainNames);
- callback(true, ntpServers, dynamicNtpServers, domainNames);
+ callback(true, ntpServers, domainNames);
},
"xyz.openbmc_project.Network", "/xyz/openbmc_project/network",
"org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
@@ -128,7 +114,7 @@ inline void getNetworkData(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const crow::Request& req)
{
asyncResp->res.jsonValue["@odata.type"] =
- "#ManagerNetworkProtocol.v1_9_0.ManagerNetworkProtocol";
+ "#ManagerNetworkProtocol.v1_5_0.ManagerNetworkProtocol";
asyncResp->res.jsonValue["@odata.id"] =
"/redfish/v1/Managers/bmc/NetworkProtocol";
asyncResp->res.jsonValue["Id"] = "NetworkProtocol";
@@ -154,7 +140,6 @@ inline void getNetworkData(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
getEthernetIfaceData(
[hostName, asyncResp](const bool& success,
const std::vector<std::string>& ntpServers,
- const std::vector<std::string>& dynamicNtpServers,
const std::vector<std::string>& domainNames) {
if (!success)
{
@@ -163,8 +148,6 @@ inline void getNetworkData(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
return;
}
asyncResp->res.jsonValue["NTP"]["NTPServers"] = ntpServers;
- asyncResp->res.jsonValue["NTP"]["NetworkSuppliedServers"] =
- dynamicNtpServers;
if (!hostName.empty())
{
std::string fqdn = hostName;
@@ -366,7 +349,7 @@ inline void
}
},
service, objectPath, "org.freedesktop.DBus.Properties",
- "Set", interface, "StaticNTPServers",
+ "Set", interface, "NTPServers",
dbus::utility::DbusVariantType{currentNtpServers});
}
}
@@ -529,7 +512,6 @@ inline void requestRoutesNetworkProtocol(App& app)
[asyncResp, ntpServerObjects](
const bool success,
std::vector<std::string>& currentNtpServers,
- std::vector<std::string>& /*dynamicNtpServers*/,
const std::vector<std::string>& /*domainNames*/) {
if (!success)
{