diff --git a/lib/facter/util/netstat.rb b/lib/facter/util/netstat.rb index 95e8b1d..5faa7a0 100644 --- a/lib/facter/util/netstat.rb +++ b/lib/facter/util/netstat.rb @@ -58,7 +58,7 @@ def self.get_route_value(route, label) c1 = map[:dest] c2 = map[label.to_sym] - ((output = get_ipv4_output).respond_to?(:lines) ? output.lines.to_a : output.to_a). { |s| s.split}.each { |a| + ((output = get_ipv4_output).respond_to?(:lines) ? output.lines.to_a : output.to_a).collect { |s| s.split}.each { |a| if a[c1] == route tmp1 << a[c2] end diff --git a/lib/puppet/provider/l3_if_downup/util/netstat.rb b/lib/puppet/provider/l3_if_downup/util/netstat.rb index 95e8b1d..5faa7a0 100644 --- a/lib/puppet/provider/l3_if_downup/util/netstat.rb +++ b/lib/puppet/provider/l3_if_downup/util/netstat.rb @@ -58,7 +58,7 @@ def self.get_route_value(route, label) c1 = map[:dest] c2 = map[label.to_sym] - ((output = get_ipv4_output).respond_to?(:lines) ? output.lines.to_a : output.to_a). { |s| s.split}.each { |a| + ((output = get_ipv4_output).respond_to?(:lines) ? output.lines.to_a : output.to_a).collect { |s| s.split}.each { |a| if a[c1] == route tmp1 << a[c2] end