From 40265ffca8b119d8924f5321411f0acc60128c6c Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 2 Dec 2018 03:07:53 +0100 Subject: [PATCH] api: fix new node action in C++ code --- lib/api/actions/node.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/api/actions/node.cpp b/lib/api/actions/node.cpp index 006c7ba42..56a15ffef 100644 --- a/lib/api/actions/node.cpp +++ b/lib/api/actions/node.cpp @@ -24,10 +24,11 @@ #include #include -#include +#include #include #include - +#include +#include #include namespace villas { @@ -37,10 +38,9 @@ namespace api { template class NodeAction : public Action { -proctected: - int action(struct node *n) = 0; - public: + using Action::Action; + virtual int execute(json_t *args, json_t **resp) { int ret; @@ -53,13 +53,13 @@ public: if (ret) return ret; - struct list *nodes = &s->api->super_node->nodes; - struct node *node = list_lookup(nodes, node_str); + struct list *nodes = session->getSuperNode()->getNodes(); + struct node *n = (struct node *) list_lookup(nodes, node_str); - if (!node) + if (!n) return -1; - return A(node); + return A(n); } };