Skip to content
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

Refactor get_cluster_host_utilization method #220

Merged
merged 2 commits into from
Jun 13, 2017

Conversation

sbeaulie
Copy link
Contributor

@sbeaulie sbeaulie commented Jun 7, 2017

The same method logic was being used in two places but only one was calling the method
get_cluster_host_utilization, so this refactors it to use the method for both.
The method could also return an empty array and the subsequent line would try
to .sort[0][1] which would return undefined method [] for nil:NilClass in that
case. The return value is now checked and an exception raised

Samuel Beaulieu added 2 commits June 7, 2017 17:04
The same method logic was being used in two places but only one was calling the method
get_cluster_host_utilization, so this refactors it to use the method for both.
The method could also return an empty array and the subsequent line would try
to .sort[0][1] which would return undefined method [] for nil:NilClass in that
case. The return value is now checked and an exception raised
Copy link
Contributor

@genebean genebean left a comment

Choose a reason for hiding this comment

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

Looks good to me

@shrug shrug merged commit ee3f5e2 into master Jun 13, 2017
@rooneyshuman rooneyshuman deleted the refactor-get_cluster_host_utilization branch June 5, 2020 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants