From 5ee179d7aed44f3eaa62b76f05649a803cd7b071 Mon Sep 17 00:00:00 2001 From: Andreas Streichardt Date: Tue, 10 May 2016 19:52:04 +0200 Subject: [PATCH] fix agency communication --- .../@arangodb/cluster/agency-communication.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/js/server/modules/@arangodb/cluster/agency-communication.js b/js/server/modules/@arangodb/cluster/agency-communication.js index 4da131ad2a..82eba5be22 100644 --- a/js/server/modules/@arangodb/cluster/agency-communication.js +++ b/js/server/modules/@arangodb/cluster/agency-communication.js @@ -73,11 +73,21 @@ exports.Communication = function() { var stubs = { get: function(route, recursive) { var ret = _agency.get(route, recursive); - return ret; + + var keys = route.split('/'); + // mop: no idea how to get the prefix here..theoretically that might be different + keys.unshift('arango'); + + var value = ret; + var currentKey = keys.shift(); + while (typeof value == 'object' && value != null && typeof currentKey == 'string') { + value = value[currentKey]; + currentKey = keys.shift(); + } + return value; }, getValue: function(route, name) { - var res = _agency.get(route + "/" + name); - return _.values(res)[0]; + return this.get(route + "/" + name, false); }, set: function(route, name, value) { if (value !== undefined) {