control: Setup configured zone groups retrieval
Configured zone groups come from either a compile time YAML generated
`_zoneLayouts` list or from a future list created at runtime after
parsing a set of JSON configuration files.
Tested:
No impact to YAML driven configurations
Empty list of zone groups created when use of JSON enabled
Change-Id: I3253ccf5c54e5397d5de0b7105fc3918dc59e24a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/manager.cpp b/control/manager.cpp
index d202fea..9213fd7 100644
--- a/control/manager.cpp
+++ b/control/manager.cpp
@@ -19,6 +19,9 @@
#include "sdbusplus.hpp"
#include "utility.hpp"
+#ifdef CONTROL_USE_JSON
+#include "json_parser.hpp"
+#endif
#include <unistd.h>
@@ -88,10 +91,14 @@
{
// Create the appropriate Zone objects based on the
// actual system configuration.
+#ifdef CONTROL_USE_JSON
+ auto zoneLayouts = getZoneGroups(bus);
+#else
+ auto zoneLayouts = _zoneLayouts;
+#endif
// Find the 1 ZoneGroup that meets all of its conditions
-#ifndef CONTROL_USE_JSON
- for (auto& group : _zoneLayouts)
+ for (auto& group : zoneLayouts)
{
auto& conditions = std::get<conditionListPos>(group);
@@ -115,7 +122,6 @@
break;
}
}
-#endif
if (mode == Mode::control)
{