If only one server is used, the amount of requests can be reduced from a
minimum of two to a minimum of one. In most cases this cuts down the
response time in half.
When the -p parameter is given without an argument, the password is read
from the command line. This allows passwords to be given to MaxCtrl in a
safer manner.
When TSV output is requested, the output should not contain the ANSI color
codes. This appears to be a "feature" of the table generation library but
it is quite simple to work around.
The function getResource had two different implementations that did very
different things. The newer version, that returns the raw JSON object that
represents a resource, was renamed to getJson.
MaxCtrl now supports explicit paths for certificates and optional server
certificate verification. This allows testing by using a self-signed
certificate with the server certificate verification turned off.
Using commas instead of spaces prevents a the misinterpretation of
commands as hostnames. If the `--hosts` option was given just before a
command, it would consume the commands as arguments to the `--hosts` list.
The `execute` command now returns the output of the command instead of
printint it. This allows the tests to actually test the output of the
commands instead manually verifying that it is correct. It also allows the
library part to be used as an actual library that only returns data.
The messages now show where the request failed and what was
requested. This should help resolve both develper and end-user problems.
Also fixed the missing logging of the output string in the `parse`
callback of the main function and cleaned up the POSTed server body.
The monitors should only be reused if they have the same name and they use
the same module. This way the only difference is in configuration.
Fixed MaxCtrl detection of bad options and altered monitor creation test
to expect correct results. Also improved some of the error messages.
All errors are now returned as rejected Promises. This will make the error
reporting more consistent with the tested output as well as the actual
output.
Added more tests for error cases and fixed minor argument processing bugs.
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.
Making the core a module proved to bring more problems than it solved. For
the sake of simplicity in installation and code coverage reporting, the
core is now completely contained in the `lib/` directory.
Also added preliminary coverage reporting with nyc.