MXS-2565: Fix list servers with sockets

The address and socket parameters need special handling.
This commit is contained in:
Markus Mäkelä 2019-06-17 14:53:22 +03:00
parent f8729c272e
commit ca532ec769
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -36,6 +36,14 @@ exports.builder = function(yargs) {
return getJson(host, 'servers')
.then((res) => {
for (var s of res.data) {
// Show the socket instead of the address
if (!s.attributes.parameters.address && s.attributes.parameters.socket) {
s.attributes.parameters.address = s.attributes.parameters.socket
s.attributes.parameters.port = ''
}
}
// Build a set of unique monitors, flatten it into an array of strings and
// filter out any duplicate or undefined values (from servers that aren't
// monitored).