From c005af22cc487f9d2c716fee38541ec290100e51 Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Thu, 18 Nov 2021 14:01:55 +0000 Subject: [PATCH] fix: set config value and create node if not existing Signed-off-by: Jason Dellaluce --- userspace/falco/configuration.cpp | 5 ----- userspace/falco/configuration.h | 5 +---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/userspace/falco/configuration.cpp b/userspace/falco/configuration.cpp index 6de8ac31..d82ad9b3 100644 --- a/userspace/falco/configuration.cpp +++ b/userspace/falco/configuration.cpp @@ -403,10 +403,5 @@ void falco_configuration::set_cmdline_option(const string &opt) throw logic_error("Error parsing config option \"" + opt + "\". Must be of the form key=val or key.subkey=val"); } - if(!m_config->is_defined(keyval.first)) - { - throw logic_error("Error parsing config option \"" + opt + "\". Option does not exist"); - } - m_config->set_scalar(keyval.first, keyval.second); } diff --git a/userspace/falco/configuration.h b/userspace/falco/configuration.h index 381de6b3..0d682df1 100644 --- a/userspace/falco/configuration.h +++ b/userspace/falco/configuration.h @@ -83,10 +83,7 @@ public: { YAML::Node node; get_node(node, key); - if(node.IsDefined()) - { - node = value; - } + node = value; } /**