summaryrefslogtreecommitdiffstats
path: root/lib/facter/macaddress.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-01-02 15:08:26 -0600
committerLuke Kanies <luke@madstop.com>2009-01-15 11:42:17 -0600
commit91e25b9cc12fcb5e8d684b6258aec20735b992e1 (patch)
treefb2617415ba9a4eb252f334bdb387d71b0266389 /lib/facter/macaddress.rb
parent074eda99ffd186a667ec3f50fbb6d4e267f585cb (diff)
downloadfacter-91e25b9cc12fcb5e8d684b6258aec20735b992e1.tar.gz
facter-91e25b9cc12fcb5e8d684b6258aec20735b992e1.tar.xz
facter-91e25b9cc12fcb5e8d684b6258aec20735b992e1.zip
Fixing indentation everywhere
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/facter/macaddress.rb')
-rw-r--r--lib/facter/macaddress.rb52
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/facter/macaddress.rb b/lib/facter/macaddress.rb
index 28ded4c..e048209 100644
--- a/lib/facter/macaddress.rb
+++ b/lib/facter/macaddress.rb
@@ -3,9 +3,9 @@ Facter.add(:macaddress) do
setcode do
ether = []
output = %x{/sbin/ifconfig -a}
- output.each {|s|
- ether.push($1) if s =~ /(?:ether|HWaddr) (\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2})/
- }
+ output.each do |s|
+ ether.push($1) if s =~ /(?:ether|HWaddr) (\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2})/
+ end
ether[0]
end
end
@@ -15,11 +15,11 @@ Facter.add(:macaddress) do
setcode do
ether = []
output = %x{/sbin/ifconfig}
- output.each {|s|
- if s =~ /(?:ether|lladdr)\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)/
- ether.push($1)
- end
- }
+ output.each do |s|
+ if s =~ /(?:ether|lladdr)\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)/
+ ether.push($1)
+ end
+ end
ether[0]
end
end
@@ -30,12 +30,12 @@ Facter.add(:macaddress) do
ether = nil
output = %x{/sbin/ifconfig}
- output.split(/^\S/).each { |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
end
- }
+ end
ether
end
@@ -47,19 +47,19 @@ Facter.add(:macaddress) do
ether = []
ip = nil
output = %x{/usr/sbin/ifconfig -a}
- output.each { |str|
+ output.each do |str|
if str =~ /([a-z]+\d+): flags=/
devname = $1
unless devname =~ /lo0/
- output2 = %x{/usr/bin/entstat #{devname}}
- output2.each { |str2|
- if str2 =~ /^Hardware Address: (\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2})/
- ether.push($1)
- end
- }
+ output2 = %x{/usr/bin/entstat #{devname}}
+ output2.each do |str2|
+ if str2 =~ /^Hardware Address: (\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2})/
+ ether.push($1)
+ end
+ end
end
end
- }
+ end
ether[0]
end
end
@@ -67,13 +67,13 @@ end
Facter.add(:macaddress) do
confine :kernel => %w(windows)
setcode do
- ether = []
- output = %x{ipconfig /all}
- 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
- end
- ether[0]
+ ether = []
+ output = %x{ipconfig /all}
+ 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
+ end
+ ether[0]
end
end