This is a temporary fix for getadapter which will hang forever if
error happens in `rinstall stage`. The root cause is the circular
reference in `runxcmd`. As global variable `$::xcmd_outref` and
`%::xcmd_outref_hash` are used to save the output message, if the
plugin command are called with runxcmd and the plugin called also
calls another plugin with `runxcmd`, the circular reference will happen.
In this situation, if the output reponse is used in a iterator,
like:
```
foreach my $line (@$res) {
xCAT::MsgUtils->message("I", $rsp, $callback);
```
`$res` points to the global variable, and `MsgUtils->message` in the
runxcmd calls also add the value in the global variable, as the
iter object is changed, the loop will not be terminated.
This patch can not solve the circular reference problem, it is just
a workaround to avoid infinite loop.
Some known issues: the error message will print twice as the
`MsgUtils->message` called in runxcmd. But we can not simply remove
it as the plugin may not be called with `runxcmd`.
Error message example:
```
Error: frame10node10: mgt configuration can not be found.
frame10node10: Unable to identify plugin for this command, check relevant tables: noderes.netboot
frame10node10: Unable to identify plugin for this command, check relevant tables: noderes.netboot
Failed to run 'nodeset' against the following nodes: frame10node10
Error: failed to run command: rinstall frame10node10 runcmd=getadapter
```
partial-fix: #3046
* Fix#3087: nodeset improvement - using multi-process to parallelize
- before deliver the request to xcatd, we can split the request to multiple sub-requests which contains different noderange
- in that, xcatd could hanle those sub-requests in parallel, just like some issue multiple commands.
* refine according to the review comments:
- not using POSIX::ceil
- Callback is reserved for filter method
* refine codes according review comments
* make the comments right and more readable.
Removing the node out of the label in order to allow the sort to happen
on just the keywords
For debug, just print the json instead of splitting to multiple lines
for the supported options based on the possible values that are
currently allowed to be returned. As more data is added, the code
should be able to handle the printing of the data automatically