Skip to content

Add a stdlib::ip_in_range() function#1003

Merged
eimlav merged 1 commit intopuppetlabs:masterfrom
iglov:master
Apr 15, 2019
Merged

Add a stdlib::ip_in_range() function#1003
eimlav merged 1 commit intopuppetlabs:masterfrom
iglov:master

Conversation

@iglov
Copy link
Copy Markdown

@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
Copy Markdown
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.

Comment thread lib/puppet/parser/functions/ip_in_range.rb Outdated
Comment thread lib/puppet/parser/functions/ip_in_range.rb Outdated
Comment thread lib/puppet/parser/functions/ip_in_range.rb Outdated
@hlindberg
Copy link
Copy Markdown
Contributor

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

@iglov
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread lib/puppet/functions/stdlib/ip_in_range.rb Outdated
Comment thread lib/puppet/functions/stdlib/ip_in_range.rb Outdated
Comment thread lib/puppet/functions/stdlib/ip_in_range.rb Outdated
@iglov
Copy link
Copy Markdown
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
Copy Markdown
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