Fix has_ip_address
and has_ip_network
functions
#1448
Merged
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.
The functions were using the old legacy function API. This meant that when they called
has_interface_with
, they were calling the legacy implementation of that function and not the v4 API version introduced in bc218f0.Only in the v4 API implementation was the modern
networking
structured fact being used. The oldparser/functions/has_interface_with.rb
version still used legacy facts that are now not included in Puppet 8 by default.In this commit, we replace the
has_ip_address
andhas_ip_network
functions with namespaced Puppet language functions, (these functions are simple enough to not need ruby). Non-namespaced versions are added (but marked as deprecated) inlib/puppet/functions
.The old implementations are removed completely. This is almost certainly not going to be a breaking change for anyone. (Only other legacy functions which in turn call these functions could be affected).
Fixes #1447