Commit 63c0a4d5 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[master] fix for CA parser (use bison, not Element::fromJSON)

parent 816dc5cc
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <agent/ca_controller.h> #include <agent/ca_controller.h>
#include <agent/ca_process.h> #include <agent/ca_process.h>
#include <agent/parser_context.h>
using namespace isc::process; using namespace isc::process;
...@@ -40,6 +41,12 @@ CtrlAgentController::createProcess() { ...@@ -40,6 +41,12 @@ CtrlAgentController::createProcess() {
return (new CtrlAgentProcess(getAppName().c_str(), getIOService())); return (new CtrlAgentProcess(getAppName().c_str(), getIOService()));
} }
isc::data::ConstElementPtr
CtrlAgentController::parseFile(const std::string& name) {
ParserContext parser;
return (parser.parseFile(name, ParserContext::PARSER_AGENT));
}
CtrlAgentController::CtrlAgentController() CtrlAgentController::CtrlAgentController()
: DControllerBase(agent_app_name_, agent_bin_name_) { : DControllerBase(agent_app_name_, agent_bin_name_) {
} }
......
...@@ -40,6 +40,13 @@ public: ...@@ -40,6 +40,13 @@ public:
/// by convention this should match the executable name. /// by convention this should match the executable name.
static const char* agent_bin_name_; static const char* agent_bin_name_;
/// @brief Parses the configuration file using Agent::ParserContext (bison)
///
/// @param name name of the text file to be parsed
/// @return Element tree structure representing parsed configuration
isc::data::ConstElementPtr
parseFile(const std::string& name);
private: private:
/// @brief Creates an instance of the Control Agent application /// @brief Creates an instance of the Control Agent application
......
...@@ -16,6 +16,7 @@ EXPECTED_VERSION="@PACKAGE_VERSION@" ...@@ -16,6 +16,7 @@ EXPECTED_VERSION="@PACKAGE_VERSION@"
CONFIG="{ CONFIG="{
\"Control-agent\": \"Control-agent\":
{ {
\"http-host\": \"127.0.0.1\"
}, },
\"Logging\": \"Logging\":
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment