Add an option flag for multi-computersystem
A number of discussions have occurred, and it's clear that
multi-computer system is not a transition that can be done in a single
series of commits, and needs to be done incrementally over time. This
commit adds the initial option for multi-computer system support, with
an option flag that can be enabled when the new behavior is desired.
This is to prevent needing a long-lived fork.
This option operatates such that if enabled, all ComputerSystem route
options will now return 404. This is to allow the redfish service
validator to pass, and to be used for incremental development. As the
routes are moved over, they will be enabled, and service validator
re-run.
Per the description in the meson options, this option flag, and all code
beneath of it will be removed on 9/1/23. The expectation is that by
this date, given the appropriate level of effort in implementation,
there will be no code remaining under that option flag. After this
date, code beneath this option flag will be removed.
Tested: No functional changes without option.
With option enabled, /redfish/v1/Systems produces no entries.
Spot check of various routes returns 404.
Redfish service validator passes.
Change-Id: I3b58642cb76d61df668076c2e0f1e7bed110ae25
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index fedf7ad..7ad489b 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1088,6 +1088,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -1359,6 +1366,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -1457,6 +1471,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
@@ -1527,6 +1548,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -1719,6 +1747,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -1826,6 +1861,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -1869,6 +1911,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -1934,6 +1983,13 @@
asyncResp->res.result(boost::beast::http::status::bad_request);
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -2103,6 +2159,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -2140,6 +2203,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -2217,6 +2287,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -2815,15 +2892,24 @@
inline void handleLogServicesDumpCollectDiagnosticDataComputerSystemPost(
crow::App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const std::string& chassisId)
+ const std::string& systemName)
{
if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
- if (chassisId != "system")
+
+ if constexpr (bmcwebEnableMultiHost)
{
- messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
+ if (systemName != "system")
+ {
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
return;
}
createDump(asyncResp, req, "System");
@@ -2843,15 +2929,23 @@
inline void handleLogServicesDumpClearLogComputerSystemPost(
crow::App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const std::string& chassisId)
+ const std::string& systemName)
{
if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
- if (chassisId != "system")
+ if constexpr (bmcwebEnableMultiHost)
{
- messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
+ if (systemName != "system")
+ {
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
return;
}
clearDump(asyncResp, "System");
@@ -3023,6 +3117,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3074,6 +3175,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3184,6 +3292,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3253,6 +3368,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3280,6 +3402,13 @@
// Do not call getRedfishRoute here since the crashdump file is not a
// Redfish resource.
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3382,6 +3511,13 @@
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3511,6 +3647,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3558,6 +3701,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3603,6 +3753,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3945,6 +4102,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
@@ -3989,6 +4153,13 @@
asyncResp->res.result(boost::beast::http::status::bad_request);
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -4068,6 +4239,13 @@
{
return;
}
+ if constexpr (bmcwebEnableMultiHost)
+ {
+ // Option currently returns no systems. TBD
+ messages::resourceNotFound(asyncResp->res, "ComputerSystem",
+ systemName);
+ return;
+ }
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",