Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä
2020-06-02 10:41:08 +03:00
7 changed files with 82 additions and 61 deletions

View File

@ -197,7 +197,7 @@ module.exports = function() {
row = []
fields.forEach(function(p) {
var v = _.getPath(i, p[p.name], '')
var v = _.getPath(i, p.path, '')
if (Array.isArray(v) && typeof(v[0]) != 'object') {
v = v.join(', ')

View File

@ -55,9 +55,10 @@ exports.builder = function(yargs) {
describe: 'Link the created server to these services',
type: 'array'
})
.option('monitors', {
describe: 'Link the created server to these monitors',
type: 'array'
.option('monitor', {
alias: 'monitors',
describe: 'Link the created server to this monitor',
type: 'string'
})
.option('protocol', {
describe: 'Protocol module name',
@ -126,10 +127,8 @@ exports.builder = function(yargs) {
}
}
if (argv.monitors) {
for (i = 0; i < argv.monitors.length; i++) {
_.set(server, 'data.relationships.monitors.data[' + i + ']', {id: argv.monitors[i], type: 'monitors'})
}
if (argv.monitor) {
_.set(server, 'data.relationships.monitors.data[0]', {id: argv.monitor, type: 'monitors'})
}
maxctrl(argv, function(host) {
@ -146,7 +145,7 @@ exports.builder = function(yargs) {
.usage('Usage: create monitor <name> <module> [params...]')
.group(['servers', 'monitor-user', 'monitor-password'], 'Create monitor options:')
.option('servers', {
describe: 'Link the created monitor to these servers',
describe: 'Link the created service to these servers. All non-option arguments after --servers are interpreted as server names e.g. `--servers srv1 srv2 srv3`.',
type: 'array'
})
.option('monitor-user', {
@ -204,7 +203,7 @@ exports.builder = function(yargs) {
.usage('Usage: service <name> <router> <params...>')
.group(['servers', 'filters'], 'Create service options:')
.option('servers', {
describe: 'Link the created service to these servers',
describe: 'Link the created service to these servers. All non-option arguments after --servers are interpreted as server names e.g. `--servers srv1 srv2 srv3`.',
type: 'array'
})
.option('filters', {

View File

@ -87,7 +87,7 @@ const list_listeners_fields = [
},
{
name: 'Host',
path: 'attributes.parameters.host',
path: 'attributes.parameters.address',
description: 'The address or socket where the listener listens'
},
{

View File

@ -73,6 +73,16 @@ describe("Diagnostic Commands", function() {
});
})
it('MXS-2984: Malformed `list listeners` output', function() {
return doCommand('list listeners RW-Split-Router --tsv')
.then(res => {
var d = res.split('\t')
d[0].should.equal('RW-Split-Listener')
d[1].should.equal('4006')
d[2].should.equal('::')
})
});
after(closeConnection)
after(stopMaxScale)
});