diff options
author | James Turnbull <james@lovedthanlost.net> | 2009-04-27 00:00:56 +1000 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-04-27 00:00:56 +1000 |
commit | 636a91de9304caf32d179b7de5ca6dca296a7f2c (patch) | |
tree | e2db552b82a7d6d563443538c492acde2a690709 /lib/facter/virtual.rb | |
parent | 9df0583dcb6f8ea6d815bceb3da33d2cb7449f08 (diff) | |
download | facter-636a91de9304caf32d179b7de5ca6dca296a7f2c.tar.gz facter-636a91de9304caf32d179b7de5ca6dca296a7f2c.tar.xz facter-636a91de9304caf32d179b7de5ca6dca296a7f2c.zip |
Partial fix for #2191 - Facter compatibility for Ruby 1.9
Diffstat (limited to 'lib/facter/virtual.rb')
-rw-r--r-- | lib/facter/virtual.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb index 97d7cba..3ad6f8a 100644 --- a/lib/facter/virtual.rb +++ b/lib/facter/virtual.rb @@ -32,7 +32,7 @@ Facter.add("virtual") do if result == "physical" output = Facter::Util::Resolution.exec('lspci') if not output.nil? - output.each do |p| + output.each_line do |p| # --- look for the vmware video card to determine if it is virtual => vmware. # --- 00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter result = "vmware" if p =~ /VM[wW]are/ @@ -40,13 +40,13 @@ Facter.add("virtual") do else output = Facter::Util::Resolution.exec('dmidecode') if not output.nil? - output.each do |pd| + output.each_line do |pd| result = "vmware" if pd =~ /VMware|Parallels/ end else output = Facter::Util::Resolution.exec('prtdiag') if not output.nil? - output.each do |pd| + output.each_line do |pd| result = "vmware" if pd =~ /VMware|Parallels/ end end @@ -61,7 +61,7 @@ Facter.add("virtual") do output = Facter::Util::Resolution.exec('mount') if not output.nil? - output.each do |p| + output.each_line do |p| result = "vserver" if p =~ /\/dev\/hdv1/ end end |