Fix sending actions

DatastoreAccess::execute functions always expect input with the prefix
deleted. This does make the test somewhat prettier, because you don't
need to repeat the prefix all the time, however, this adds complexity to
the `execute` functions, because you have to consider that. Also what
really happens inside NetconfAccess/SysrepoAccess is that it just gets
concatenated again.

The actual bug is this: when using ProxyDatastore datastore to send
RPC/action, getItems is called to get the input. This algorithm was
supposed to strip the prefixes. But there was an error in this stripping
algorithm, because stripping an "action" path is more difficult than RPC
because it can be nested.

The solution: get rid of the compacted paths in input to simplify the
algorithms.

Also, there is another bug, where the output XPaths don't get the action
prefix trimmed because the input action path is fully prefixed, but the
output XPaths aren't. More info in comment.

Change-Id: I28acaffadb55d89e508d75d58d365a3523f295bb
diff --git a/src/netconf_access.cpp b/src/netconf_access.cpp
index b5f7ccb..b599c2c 100644
--- a/src/netconf_access.cpp
+++ b/src/netconf_access.cpp
@@ -136,8 +136,7 @@
 {
     auto root = m_schema->dataNodeFromPath(path);
     for (const auto& [k, v] : input) {
-        auto node = m_schema->dataNodeFromPath(joinPaths(path, k), leafDataToString(v));
-        root->merge(node, 0);
+        root->new_path(m_session->libyangContext(), k.c_str(), leafDataToString(v).c_str(), LYD_ANYDATA_CONSTSTRING, LYD_PATH_OPT_UPDATE);
     }
     auto data = root->print_mem(LYD_XML, 0);
 
@@ -145,8 +144,11 @@
     auto output = m_session->rpc_or_action(data);
     if (output) {
         // If there's output, it will be a top-level node. In case of action, the output can be nested so we need to use
-        // find_path to get to the actual output.
-        lyNodesToTree(res, output->find_path(path.c_str())->data(), joinPaths(path, "/"));
+        // find_path to get to the actual output. Also, our `path` is fully prefixed, but the output paths aren't. So
+        // we use outputNode->path() to get the unprefixed path.
+
+        auto outputNode = output->find_path(path.c_str())->data().front();
+        lyNodesToTree(res, {outputNode}, joinPaths(outputNode->path(), "/"));
     }
     return res;
 }