Skip to content
Snippets Groups Projects
Commit 61ca2513 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Make resolve_ipnets() work under Ruby 2 again.

The ipfamilies parameter to the resolve_ipnets__netspec() helper
function was intended to be a list of IP address families (including
the special marker "__ANY").  However, in the case where no explicit
address family flag was passed to resolve_ipnets(), we passed in a
ipfamilies parameter of the string "__ANY", instead of a one-item
list of said string.  This happened to work under Ruby 1.8, where
strings have an #each method which works as if it was a one-item
list.  In Ruby 2.0, however, strings don't have a #each method.

Make sure to always pass in a list to resolve_ipnets__netspec().

This was originally commit dcc1f6df8e7f in nsc-puppet-utils.
parent b8cba609
No related branches found
No related tags found
No related merge requests found
......@@ -186,7 +186,7 @@ module Puppet::Parser::Functions
end
end
if ipfamilies.length == 0
ipfamilies = '__ANY'
ipfamilies << '__ANY'
end
res = []
[netspecs].flatten.each do |netspec|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment