-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapted the existing checks to work with ascs_ers cluster #475
Adapted the existing checks to work with ascs_ers cluster #475
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good job @ksanjeet
Just a couple of comments.
- Add a
else
statement returning fale - Add new lines, it is easier to read
I will merge once you apply those 2 things
priv/catalog/6E9B82.yaml
Outdated
expect: facts.corosync_twonode == values.expected_twonode | ||
failure_message: Corosync 'two_node' value was expected to be '${values.expected_twonode}' but configured value is '${facts.corosync_twonode}' | ||
expect: | | ||
if facts.corosync_num_nodes.len == 2 { facts.corosync_twonode == values.expected_twonode } else if facts.corosync_num_nodes.len >= 3 { facts.corosync_twonode == values.expected_threeormore } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ksanjeet
Here we have a blank sport if for some reason the num of nodes is 1.
Maybe we should add this condition and return false
, in the final else
statement.
I know it is a corner case, but i don't know how our engine would behave if we don't return a boolean. Most probably the check would fail with a unknown reason.
priv/catalog/D78671.yaml
Outdated
expect: facts.runtime_two_node == values.expected_runtime_two_node | ||
failure_message: Corosync 'two_node' value was expected to be '${values.expected_runtime_two_node}' but value of running config is '${facts.runtime_two_node}' | ||
expect: | | ||
if facts.corosync_num_nodes.len == 2 { facts.runtime_two_node == values.expected_runtime_two_node } else if facts.corosync_num_nodes.len >= 3 { facts.runtime_two_node == values.expected_runtime_threeormore } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a final else
here as well.
By the way, the code would looks easier to read if you add some new lines. To look like:
if facts.corosync_num_nodes.len == 2 {
facts.runtime_two_node == values.expected_runtime_two_node
} else if facts.corosync_num_nodes.len >= 3 {
facts.runtime_two_node == values.expected_runtime_threeormore
} else {
false
}
…ondition at the end which results to false
Thank you @ksanjeet |
Yes, please. |
Adapted 3 community checks "6E9B82", "C620DC" and "D78671" to work with ascs_ers cluster. The existing checks had constant values for corosync configurations "two_node" and "expected_vote" which in this adaptation is changed to use conditional checks and depends upon how many nodes are configured in corosync and cib.