[Pkg-puppet-devel] [facter] 09/61: (#21533) Convert network data to string before access

Stig Sandbeck Mathisen ssm at debian.org
Mon Nov 4 15:01:40 UTC 2013


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit d49f646fe621d72d9066e3402be5e6ba7da5d5eb
Author: Elias Probst <mail at eliasprobst.eu>
Date:   Sat Jun 29 01:19:19 2013 +0200

    (#21533) Convert network data to string before access
---
 lib/facter/ipaddress6.rb   |    2 +-
 lib/facter/macaddress.rb   |    2 +-
 lib/facter/util/netmask.rb |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/facter/ipaddress6.rb b/lib/facter/ipaddress6.rb
index b05ab9a..4e44d13 100644
--- a/lib/facter/ipaddress6.rb
+++ b/lib/facter/ipaddress6.rb
@@ -26,7 +26,7 @@ require 'facter/util/ip'
 def get_address_after_token(output, token, return_first=false)
   ip = nil
 
-  output.scan(/#{token} ((?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/).each do |match|
+  String(output).scan(/#{token} ((?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/).each do |match|
     match = match.first
     unless match =~ /fe80.*/ or match == "::1"
       ip = match
diff --git a/lib/facter/macaddress.rb b/lib/facter/macaddress.rb
index 6c0ef78..3bcc927 100644
--- a/lib/facter/macaddress.rb
+++ b/lib/facter/macaddress.rb
@@ -29,7 +29,7 @@ Facter.add(:macaddress) do
     ether = []
     output = Facter::Util::IP.exec_ifconfig(["-a","2>/dev/null"])
 
-    output.each_line do |s|
+    String(output).each_line do |s|
       ether.push($1) if s =~ /(?:ether|HWaddr) ((\w{1,2}:){5,}\w{1,2})/
     end
     Facter::Util::Macaddress.standardize(ether[0])
diff --git a/lib/facter/util/netmask.rb b/lib/facter/util/netmask.rb
index 7f1d279..41503c8 100644
--- a/lib/facter/util/netmask.rb
+++ b/lib/facter/util/netmask.rb
@@ -25,7 +25,7 @@ module Facter::NetMask
       }
     end
 
-    Facter::Util::IP.exec_ifconfig(ops[:ifconfig_opts]).split(/\n/).collect do |line|
+    String(Facter::Util::IP.exec_ifconfig(ops[:ifconfig_opts])).split(/\n/).collect do |line|
       matches = line.match(ops[:regex])
       if !matches.nil?
         if ops[:munge].nil?

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list