From 9ea60b8f2c1a764fcce0b659df359c7014f90220 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Tue, 15 Apr 2014 16:22:05 +0400 Subject: [PATCH] Fix ruby 2.* incompatibility in netstat functions Change-Id: I1b920596597218a0fff24a7ad1be5f8f9b285384 --- deployment/puppet/l23network/lib/facter/util/netstat.rb | 2 +- .../l23network/lib/puppet/provider/l3_if_downup/util/netstat.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/puppet/l23network/lib/facter/util/netstat.rb b/deployment/puppet/l23network/lib/facter/util/netstat.rb index 7960a5d105..dc381972c3 100644 --- a/deployment/puppet/l23network/lib/facter/util/netstat.rb +++ b/deployment/puppet/l23network/lib/facter/util/netstat.rb @@ -58,7 +58,7 @@ module Facter::Util::NetStat c1 = map[:dest] c2 = map[label.to_sym] - get_ipv4_output.to_a.collect { |s| s.split}.each { |a| + get_ipv4_output.split("\n").map { |l| l.split }.each { |a| if a[c1] == route tmp1 << a[c2] end diff --git a/deployment/puppet/l23network/lib/puppet/provider/l3_if_downup/util/netstat.rb b/deployment/puppet/l23network/lib/puppet/provider/l3_if_downup/util/netstat.rb index 7960a5d105..782bfb7e13 100644 --- a/deployment/puppet/l23network/lib/puppet/provider/l3_if_downup/util/netstat.rb +++ b/deployment/puppet/l23network/lib/puppet/provider/l3_if_downup/util/netstat.rb @@ -58,7 +58,7 @@ module Facter::Util::NetStat c1 = map[:dest] c2 = map[label.to_sym] - get_ipv4_output.to_a.collect { |s| s.split}.each { |a| + get_ipv4_output.split("\n").map { |s| s.split}.each { |a| if a[c1] == route tmp1 << a[c2] end