diff --git a/include/villas/super_node.hpp b/include/villas/super_node.hpp index de484788f..aa8ca2ded 100644 --- a/include/villas/super_node.hpp +++ b/include/villas/super_node.hpp @@ -73,19 +73,17 @@ public: int init(); - /** Wrapper for super_node_parse() */ - int parseUri(const std::string &name); + /** Wrapper for parse() */ + void parseUri(const std::string &name); /** Parse super-node configuration. * * @param cfg A libjansson object which contains the configuration. - * @retval 0 Success. Everything went well. - * @retval <0 Error. Something went wrong. */ - int parseJson(json_t *cfg); + void parseJson(json_t *cfg); /** Check validity of super node configuration. */ - int check(); + void check(); /** Initialize after parsing the configuration file. */ void prepare(); diff --git a/lib/super_node.cpp b/lib/super_node.cpp index 47c9d35ed..3ee8d49d0 100644 --- a/lib/super_node.cpp +++ b/lib/super_node.cpp @@ -81,7 +81,7 @@ SuperNode::SuperNode() : logger = logging.get("super_node"); } -int SuperNode::parseUri(const std::string &u) +void SuperNode::parseUri(const std::string &u) { json_error_t err; @@ -160,12 +160,10 @@ int SuperNode::parseUri(const std::string &u) uri = u; - return parseJson(json); - - return 0; + parseJson(json); } -int SuperNode::parseJson(json_t *j) +void SuperNode::parseJson(json_t *j) { int ret; const char *nme = nullptr; @@ -290,11 +288,9 @@ parse: path *p = (path *) alloc(sizeof(path)); json = j; state = STATE_PARSED; - - return 0; } -int SuperNode::check() +void SuperNode::check() { int ret; @@ -317,8 +313,6 @@ int SuperNode::check() } state = STATE_CHECKED; - - return 0; } void SuperNode::startNodeTypes() diff --git a/src/villas-node.cpp b/src/villas-node.cpp index a95750f8f..f5e4b17c7 100644 --- a/src/villas-node.cpp +++ b/src/villas-node.cpp @@ -171,18 +171,12 @@ int main(int argc, char *argv[]) if (ret) throw RuntimeError("Failed to initialize signal subsystem"); - if (uri) { - ret = sn.parseUri(uri); - if (ret) - throw RuntimeError("Failed to parse command line arguments"); - } + if (uri) + sn.parseUri(uri); else logger->warn("No configuration file specified. Starting unconfigured. Use the API to configure this instance."); - ret = sn.check(); - if (ret) - throw RuntimeError("Failed to verify configuration"); - + sn.check(); sn.prepare(); sn.start(); sn.run(); diff --git a/src/villas-pipe.cpp b/src/villas-pipe.cpp index 8adc41318..7413ed245 100644 --- a/src/villas-pipe.cpp +++ b/src/villas-pipe.cpp @@ -349,11 +349,8 @@ check: if (optarg == endptr) if (ret) throw RuntimeError("Failed to initialize signals"); - if (uri) { - ret = sn.parseUri(uri); - if (ret) - throw RuntimeError("Failed to parse configuration"); - } + if (uri) + sn.parseUri(uri); else logger->warn("No configuration file specified. Starting unconfigured. Use the API to configure this instance."); diff --git a/src/villas-test-rtt.cpp b/src/villas-test-rtt.cpp index 8c6c1812f..8429941dd 100644 --- a/src/villas-test-rtt.cpp +++ b/src/villas-test-rtt.cpp @@ -151,11 +151,8 @@ check: if (optarg == endptr) if (ret) throw RuntimeError("Failed to initialize signals subsystem"); - if (uri) { - ret = sn.parseUri(uri); - if (ret) - throw RuntimeError("Failed to parse configuration"); - } + if (uri) + sn.parseUri(uri); else logger->warn("No configuration file specified. Starting unconfigured. Use the API to configure this instance.");