control: Add event actions
Generate the action objects and add them to the event.
Change-Id: Iea1d6e7cc5e3666aef0b109f6da05bd924142248
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/event.cpp b/control/json/event.cpp
index b5e986d..971c875 100644
--- a/control/json/event.cpp
+++ b/control/json/event.cpp
@@ -15,6 +15,7 @@
*/
#include "event.hpp"
+#include "action.hpp"
#include "config_base.hpp"
#include "group.hpp"
#include "manager.hpp"
@@ -156,6 +157,12 @@
entry("JSON=%s", action.dump().c_str()));
throw std::runtime_error("Missing required event action name");
}
+ auto actObj =
+ ActionFactory::getAction(action["name"].get<std::string>(), action);
+ if (actObj)
+ {
+ _actions.emplace_back(std::move(actObj));
+ }
}
}