Skip to content
This repository was archived by the owner on Feb 27, 2020. It is now read-only.

Conversation

@Ying-metaswitch
Copy link
Contributor

@Ying-metaswitch Ying-metaswitch commented Nov 1, 2017

No real test was done due to Chef problem. Tested that the script will return 0 when no restart was going on.

Copy link
Contributor

@RobDover RobDover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants