NodeUtil.pm: slight bug on version extraction #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Caused by an error as an example:
vagrant@node_manager:~$ /usr/local/bin/masterha_check_repl --conf=/etc/app1.cnf
Fri May 3 00:59:43 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Fri May 3 00:59:43 2019 - [info] Reading application default configuration from /etc/app1.cnf..
Fri May 3 00:59:43 2019 - [info] Reading server configuration from /etc/app1.cnf..
Fri May 3 00:59:43 2019 - [info] MHA::MasterMonitor version 0.58.
Fri May 3 00:59:44 2019 - [error][/usr/local/share/perl/5.26.1/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. Redundant argument in sprintf at /usr/local/share/perl/5.26.1/MHA/NodeUtil.pm line 195.
Fri May 3 00:59:44 2019 - [error][/usr/local/share/perl/5.26.1/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Fri May 3 00:59:44 2019 - [info] Got exit code 1 (Not master dead).
It would be more readable and easy to follow using array and then splice based only on the indexes needed to be parsed in Major and Minor version