This repository was archived by the owner on Feb 27, 2020. It is now read-only.
Open
Conversation
RobDover
suggested changes
May 15, 2018
Contributor
RobDover
left a comment
There was a problem hiding this comment.
Mostly looks good. Can you add a docstring to describe_queue_state that explains what it does and what it will return? Other than that just the one comment.
| apply_config_key=${apply_config_key#$prefix} | ||
|
|
||
| /usr/share/clearwater/clearwater-queue-manager/env/bin/python /usr/share/clearwater/clearwater-queue-manager/scripts/check_queue_state.py "${management_local_ip:-$local_ip}" "$local_site_name" "$apply_config_key" | ||
| rc=$(($?>rc?$?:rc)) |
Contributor
There was a problem hiding this comment.
Urgh. This is pretty hard to follow! I suggest you either:
- Add a comment to explain what this line does
- Change this to something that's a bit less compact but easier to understand. How about just:
queue_state=$?
if [[ $queue_state > $rc ]]
then
rc=$queue_state
fi
I think this will be a lot clearer for future code readers to understand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No real test was done due to Chef problem. Tested that the script will return 0 when no restart was going on.