CASMCMS-8946: Correct two problems with operating on empty node lists #263
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.
This PR addresses two problems:
In the base BOS operator, when it is detecting and acting on components, up front it gets a list of components and returns if it is empty. But then it filters that list to remove any components which have exceeded their retry limits. After doing that, it does not check again to see if the list is empty, even though it may be. This PR adds a check after that filtering.
The CAPMC client
power
function is supposed to return aCapmcXnameOnOffReturnedError
object. The code in the_power_components
method in the base power operator depends on this, because it assumes the returned object will have anerror_code
attribute. However, if an empty list of nodes is passed into thepower
function, then it returns a tuple of an empty set and an empty dictionary. From the git history, this just looks like an early piece of prototyping code that never got updated. This PR changes it so that it instead returns an "empty" object of the correct kind. (I also verified that no other code calls thepower
function and for some reason depends on the current behavior)Jira: https://jira-pro.it.hpe.com:8443/browse/CASMCMS-8946
CSM 1.5.1 PR: #264
CSM 1.6 PR: #265