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

Use puppet4 functions-api #402

Merged
merged 2 commits into from
Jan 18, 2018
Merged

Conversation

juliantodt
Copy link
Member

The legacy puppet3 functions-api should be avoided.
This migrates the existing function and its test to the new api and uses it in the module.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

This is great! It was on my list to pick up and I greatly appreciate this.


Puppet::Functions.create_function(:'foreman_proxy::get_network_in_addr') do
dispatch :get_network_in_addr do
required_param 'String', :addr
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer full names (address and netmask) for readability. Also wondering if we should use the ip address type from stdlib and remove the begin/rescue code around the IPAddr.new calls.

Copy link
Member

@ekohl ekohl 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.

@mmoll
Copy link
Contributor

mmoll commented Jan 18, 2018

untested, but looks good 👍

@mmoll mmoll merged commit b3b1142 into theforeman:master Jan 18, 2018
@mmoll
Copy link
Contributor

mmoll commented Jan 18, 2018

merged, danke @juliantodt!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants