MXS-1300: Fix deletion of monitors

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.
This commit is contained in:
Markus Mäkelä
2017-08-03 20:24:55 +03:00
parent af847c29c3
commit e133e758a6
6 changed files with 26 additions and 23 deletions

View File

@ -19,6 +19,8 @@ const maxctrl_version = '1.0.0';
program
.version(maxctrl_version)
.strict()
.exitProcess(false)
.showHelpOnFail(false)
.group(['u', 'p', 'h', 's', 't', 'q', 'tsv'], 'Global Options:')
.option('u', {
alias:'user',
@ -96,6 +98,10 @@ module.exports.execute = function(argv, opts) {
return new Promise(function(resolve, reject) {
program
.parse(argv, {resolve: resolve, reject: reject})
.parse(argv, {resolve: resolve, reject: reject}, function(err, argv, output) {
if (err) {
reject(err)
}
})
})
}