control: Correct which json object used in event actions
Change-Id: I6fbbf50d99748129832c30ec61b6f2e77a71dfbc
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/event.cpp b/control/json/event.cpp
index e50e67e..d5ec01f 100644
--- a/control/json/event.cpp
+++ b/control/json/event.cpp
@@ -156,9 +156,9 @@
// Append action specific groups to the list of event groups for each
// action in the event
auto actionGroups = _groups;
- if (jsonObj.contains("groups"))
+ if (jsonAct.contains("groups"))
{
- for (const auto& jsonGrp : jsonObj["groups"])
+ for (const auto& jsonGrp : jsonAct["groups"])
{
if (!jsonGrp.contains("name"))
{
@@ -194,7 +194,7 @@
// Determine list of zones action should be run against
std::vector<std::reference_wrapper<Zone>> actionZones;
- if (!jsonObj.contains("zones"))
+ if (!jsonAct.contains("zones"))
{
// No zones configured on the action results in the action running
// against all zones matching the event's active profiles
@@ -217,7 +217,7 @@
{
// Zones configured on the action result in the action only running
// against those zones if they match the event's active profiles
- for (const auto& jsonZone : jsonObj["zones"])
+ for (const auto& jsonZone : jsonAct["zones"])
{
configKey eventProfile =
std::make_pair(jsonZone.get<std::string>(), _profiles);