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

Add a stdlib::ip_in_range() function #1003

Merged
merged 1 commit into from
Apr 15, 2019
Merged

Conversation

iglov
Copy link

@iglov iglov commented Mar 7, 2019

It's very useful function from https://github.com/deanwilson/puppet-ip_in_range . Why you haven't include it so far?

@hlindberg
Copy link
Contributor

I think this needs to be refactored to use the modern (4.x) function API, and that the function should be namespaced to stdlib to avoid potentially clashing with similar function in other modules (namespacing cannot be done in the 3.x API).
There is also the need to clean up the commits.

Others need to chime in on the usefulness of the function and if it should be added to stdlib in the first place. I will make some review comments meanwhile.

lib/puppet/parser/functions/ip_in_range.rb Outdated Show resolved Hide resolved
lib/puppet/parser/functions/ip_in_range.rb Outdated Show resolved Hide resolved
lib/puppet/parser/functions/ip_in_range.rb Outdated Show resolved Hide resolved
@hlindberg
Copy link
Contributor

This documentation may be of value: https://puppet.com/docs/puppet/6.3/functions_refactor_legacy.html

@iglov
Copy link
Author

iglov commented Mar 22, 2019

Hey, @hlindberg ! Thank u, for ur revision, i appreciate it! I've done some fixes. Could u plz check it and says what should i doing next?
P.S. How i should clear commits? Create new pull request with 1 commit? :)

Copy link
Contributor

@hlindberg hlindberg left a comment

Choose a reason for hiding this comment

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

Much better! I added a couple of suggestions with improvements to the documentation of the parameters.
Once you changed this, do squash all your commits into one and write the commit comment in imperative form (suggestion): Add a stdlib::ip_in_range() function to check if a given IP is in a given range

lib/puppet/functions/stdlib/ip_in_range.rb Outdated Show resolved Hide resolved
lib/puppet/functions/stdlib/ip_in_range.rb Outdated Show resolved Hide resolved
lib/puppet/functions/stdlib/ip_in_range.rb Outdated Show resolved Hide resolved
@iglov
Copy link
Author

iglov commented Mar 24, 2019

Hey, @hlindberg ! Thanks a lot, ur so helpful! Now, how i think, i totally done with this task :)

@eimlav eimlav added the feature label Apr 15, 2019
@eimlav
Copy link
Contributor

eimlav commented Apr 15, 2019

Hi @iglov . Thanks for your contribution (and @hlindberg for reviewing). This change looks good to me. Cheers!

@eimlav eimlav changed the title Just added simple function by deanwilson ip_in_range Add a stdlib::ip_in_range() function Apr 15, 2019
@eimlav eimlav merged commit 6cbf017 into puppetlabs:master Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants