diff --git a/maxctrl/lib/cluster.js b/maxctrl/lib/cluster.js index a2e2e9679..b4ee9cc3e 100644 --- a/maxctrl/lib/cluster.js +++ b/maxctrl/lib/cluster.js @@ -171,8 +171,16 @@ exports.builder = function(yargs) { getDifference(src.servers.data, dest.servers.data).forEach(function(i) { // Create the servers without relationships, those are generated when services and // monitors are updated - delete i.relationships - promises.push(doAsyncRequest(host, 'servers', null, {method: 'POST', body: {data: i}})) + var newserv = { + data: { + id: i.id, + type: i.type, + attributes: { + parameters: i.attributes.parameters + } + } + } + promises.push(doAsyncRequest(host, 'servers', null, {method: 'POST', body: newserv})) }) return Promise.all(promises) .then(function() { diff --git a/maxctrl/lib/common.js b/maxctrl/lib/common.js index a444ba107..ccc4e210d 100644 --- a/maxctrl/lib/common.js +++ b/maxctrl/lib/common.js @@ -195,9 +195,9 @@ module.exports = function() { } }, function(err) { if (err.response && err.response.body) { - return error('Server responded with status code ' + err.statusCode + ' to `' + err.response.request.method +' ' + resource + '`:' + JSON.stringify(err.response.body, null, 4)) + return error('Server at '+ err.response.request.uri.host +' responded with status code ' + err.statusCode + ' to `' + err.response.request.method +' ' + resource + '`:' + JSON.stringify(err.response.body, null, 4)) } else if (err.statusCode) { - return error('Server responded with status code ' + err.statusCode + ' to `' + err.response.request.method +' ' + resource + '`') + return error('Server at '+ err.response.request.uri.host +' responded with status code ' + err.statusCode + ' to `' + err.response.request.method +' ' + resource + '`') } else if (err.error) { return error(JSON.stringify(err.error, null, 4)) } else { diff --git a/maxctrl/lib/core.js b/maxctrl/lib/core.js index 13105d640..60d4e4c0c 100644 --- a/maxctrl/lib/core.js +++ b/maxctrl/lib/core.js @@ -100,7 +100,9 @@ module.exports.execute = function(argv, opts) { program .parse(argv, {resolve: resolve, reject: reject}, function(err, argv, output) { if (err) { - reject(err) + reject(err.message) + } else if (output) { + logger.log(output) } }) })