Closed
Conversation
Move the calls to request.do_request(...) to a method to encapsulate the params
lib/puppet/indirector/rest.rb
Outdated
Contributor
There was a problem hiding this comment.
I'm not sure there is a need for this comment. Maybe include it in the commit message, but it seems obvious what the code does.
Contributor
Author
There was a problem hiding this comment.
Agreed. Thought there might be pushback because the change seemed simple, so thought I should provide justification. Updated.
Move comment to commit message.
Encapsulate call to request.do_request with the arguments from this class
Then yield to the code block that was called in
We certainly could have retained the full request.do_request(...) {|r| ... }
but this makes the code much cleaner and we only then actually make the call
to request.do_request from here, thus if we change what we pass or how we
get it, we only need to change it here.
Contributor
|
I actually liked the version with the comment better, so I cherry-picked just the first commit and hand-merged it. Thanks for the contribution. |
melissa
pushed a commit
to melissa/puppet
that referenced
this pull request
Mar 30, 2018
…1-pxp-agent_acceptance_should_support_a_failover_pcp-broker-b (PCP-431) fix previous acceptance commit
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Move the calls to request.do_request(...) to a method to encapsulate
the params
Encapsulate call to request.do_request with the arguments from this class
Then yield to the code block that was called in
We certainly could have retained the full request.do_request(...) {|r| ... }
but this makes the code much cleaner and we only then actually make the call
to request.do_request from here, thus if we change what we pass or how we
get it, we only need to change it here.