MXS-1300: Take the refactored core into use

The refactored maxctrl function is now in use.
This commit is contained in:
Markus Mäkelä
2017-07-15 06:59:49 +03:00
parent b98b326bba
commit 3255d58e70
18 changed files with 178 additions and 122 deletions

View File

@ -13,8 +13,8 @@
require('../common.js')()
function addServer(argv, path, targets) {
maxctrl(argv)
.doRequest(path, function(res) {
maxctrl(argv, function(host){
return doRequest(host, path, function(res) {
var servers =_.get(res, 'data.relationships.servers.data', [])
targets.forEach(function(i){
@ -25,9 +25,9 @@ function addServer(argv, path, targets) {
_.set(res, 'data.relationships.servers.data', servers)
delete res.data.attributes
return maxctrl(argv)
.doAsyncRequest(path, null, {method: 'PATCH', body: res})
return doAsyncRequest(host, path, null, {method: 'PATCH', body: res})
})
})
}
exports.command = 'link <command>'