Changed glusterfs.peer() module so state can handle localhost peering attempts. #30987
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.
When the _gluster_xml command-calling method was introduced, glusterfs.peer() lost the ability to pass the output string back to the calling function. This meant that, in the case that you were attempting to peer probe localhost, glusterfs.peer would return successfully, the state would populate its .comment return value with a boolean value, and the output formatters would not be able to cast bool correctly, making the output look different. Not a functional regression, just a display one.
This just changes glusterfs.peer() to return a dict with the return code and output - possibly overkill since it's not used anywhere, but it's a little nicer for command-line execution now as well. I couldn't find any other references to return codes anywhere else, but if people were relying on the return val of the module being boolean, this would break that.
I think having the command exitval is more useful, personally.