]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] fix for CA parser (use bison, not Element::fromJSON)
authorTomek Mrugalski <tomasz@isc.org>
Thu, 9 Mar 2017 12:40:23 +0000 (13:40 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Thu, 9 Mar 2017 12:40:23 +0000 (13:40 +0100)
src/bin/agent/ca_controller.cc
src/bin/agent/ca_controller.h
src/bin/agent/tests/ca_process_tests.sh.in

index a5508abdb7eeeeaa2a3fe4aed092005dce0ce4db..475072bf66bf971f2f57df941913c0319fa83111 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <agent/ca_controller.h>
 #include <agent/ca_process.h>
+#include <agent/parser_context.h>
 
 using namespace isc::process;
 
@@ -40,6 +41,12 @@ CtrlAgentController::createProcess() {
     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()
     : DControllerBase(agent_app_name_, agent_bin_name_) {
 }
index f2c65b78e20c1eb10dc3e0c8dcf74b13e9b091c5..1f2f34417a410d3495750daa7586080931d5f1c0 100644 (file)
@@ -40,6 +40,13 @@ public:
     /// by convention this should match the executable 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:
 
     /// @brief Creates an instance of the Control Agent application
index 77fe66280b6d655df1da789f5157432791dad597..e4f8902160ec83de92a556da71e60e6f703bf4e9 100644 (file)
@@ -16,6 +16,7 @@ EXPECTED_VERSION="@PACKAGE_VERSION@"
 CONFIG="{
     \"Control-agent\":
     {
+        \"http-host\": \"127.0.0.1\"
     },
     \"Logging\":
     {