MXS-1300: Fix logging and maxscale alteration
The alterations to logging and maxscale were sending malformed JSON to MaxScale. Boolean values weren't converted to JSON booleans but were sent as strings.
This commit is contained in:
parent
310ef3b31e
commit
53789f3b4b
@ -34,12 +34,12 @@ exports.builder = function(yargs) {
|
||||
})
|
||||
.command('logging <key> <value>', 'Alter logging parameters', {}, function(argv) {
|
||||
maxctrl(argv, function(host) {
|
||||
return updateValue(host, 'maxscale/logs', 'attributes.parameters.' + argv.key, argv.value)
|
||||
return updateValue(host, 'maxscale/logs', 'data.attributes.parameters.' + argv.key, argv.value)
|
||||
})
|
||||
})
|
||||
.command('maxscale <key> <value>', 'Alter MaxScale parameters', {}, function(argv) {
|
||||
maxctrl(argv, function(host) {
|
||||
return updateValue(host, 'maxscale', 'attributes.parameters.' + argv.key, argv.value)
|
||||
return updateValue(host, 'maxscale', 'data.attributes.parameters.' + argv.key, argv.value)
|
||||
})
|
||||
})
|
||||
.usage('Usage: alter <command>')
|
||||
|
@ -142,6 +142,14 @@ module.exports = function() {
|
||||
|
||||
this.updateValue = function(host, resource, key, value) {
|
||||
var body = {}
|
||||
|
||||
// Convert string booleans into JSON booleans
|
||||
if (value == "true") {
|
||||
value = true
|
||||
} else if (value == "false") {
|
||||
value = false
|
||||
}
|
||||
|
||||
_.set(body, key, value)
|
||||
return doRequest(host, resource, null, { method: 'PATCH', body: body })
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user