fix: set config value and create node if not existing

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce 2021-11-18 14:01:55 +00:00 committed by poiana
parent c93029ce74
commit c005af22cc
2 changed files with 1 additions and 9 deletions

View File

@ -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"); 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); m_config->set_scalar(keyval.first, keyval.second);
} }

View File

@ -83,10 +83,7 @@ public:
{ {
YAML::Node node; YAML::Node node;
get_node(node, key); get_node(node, key);
if(node.IsDefined()) node = value;
{
node = value;
}
} }
/** /**