[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, upstream, updated. 3a39dd8353b6308cf49522990104cc63e55d7cda
Paul Nasrat
pnasrat at googlemail.com
Fri Jan 29 17:22:23 UTC 2010
The following commit has been merged in the upstream branch:
commit 2518312500b63d818815c8cdb0c6af2c8e0f6dd7
Author: Paul Nasrat <pnasrat at googlemail.com>
Date: Mon May 11 06:23:59 2009 +0100
Fix #2236 - don't use each_line on arrays
This fixes up the syntax so that we can get 1.5.5 out, I've not done tests for
this as we need to fixup the number of time we call out to ifconfig and the
duplication with ip.rb.
Paul
diff --git a/lib/facter/macaddress.rb b/lib/facter/macaddress.rb
index 94d00f4..f978b17 100644
--- a/lib/facter/macaddress.rb
+++ b/lib/facter/macaddress.rb
@@ -30,7 +30,7 @@ Facter.add(:macaddress) do
ether = nil
output = %x{/sbin/ifconfig}
- output.split(/^\S/).each_line do |str|
+ output.split(/^\S/).each do |str|
if str =~ /10baseT/ # we're wired
str =~ /ether (\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)/
ether = $1
@@ -69,7 +69,7 @@ Facter.add(:macaddress) do
setcode do
ether = []
output = %x{ipconfig /all}
- output.split(/\r\n/).each_line do |str|
+ output.split(/\r\n/).each do |str|
if str =~ /.*Physical Address.*: (\w{1,2}-\w{1,2}-\w{1,2}-\w{1,2}-\w{1,2}-\w{1,2})/
ether.push($1.gsub(/-/, ":"))
end
--
Packaging of Facter for debian
More information about the Pkg-puppet-devel
mailing list