diff options
| author | Jacob Helwig <jacob@puppetlabs.com> | 2011-03-08 11:23:11 -0800 |
|---|---|---|
| committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-03-08 11:23:11 -0800 |
| commit | 469d2a26a467c50af9f9732d7f98e8a01ecc369f (patch) | |
| tree | cb5f4d7b64404105d7b43492d36437201cb13e08 /lib | |
| parent | 154d2a26a1cd81395c370a586a264f6ed13b0fb3 (diff) | |
| parent | fd38ce08cdcd8b3357400787089c34b1b61d4551 (diff) | |
| download | facter-469d2a26a467c50af9f9732d7f98e8a01ecc369f.tar.gz facter-469d2a26a467c50af9f9732d7f98e8a01ecc369f.tar.xz facter-469d2a26a467c50af9f9732d7f98e8a01ecc369f.zip | |
Merge branch 'next'
* next:
Fixed #5950 - Solaris ipaddress incorrect after bonding failure
(#6615) fix missing stub calls in loader specs
(#5666) windows support for facter/id.rb
(#4925) - MS Windows doesn't do man pages
Fixed #6611 - Fixed broken HPVM test and rationalised test structure
(#6525) change semicolons to 'then' in case statement for ruby 1.9.2 compatibility
Fixes #6521 and other Ruby 1.9 issues
Fixed #6525 - Test failures on Ruby 1.9.x
(#5031) Remove redundant puts from RDoc.usage
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/facter/application.rb | 2 | ||||
| -rw-r--r-- | lib/facter/id.rb | 2 | ||||
| -rw-r--r-- | lib/facter/ipaddress.rb | 2 | ||||
| -rw-r--r-- | lib/facter/lsb.rb | 8 | ||||
| -rw-r--r-- | lib/facter/util/virtual.rb | 4 | ||||
| -rw-r--r-- | lib/facter/util/vlans.rb | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/lib/facter/application.rb b/lib/facter/application.rb index 9d6bc34..6b351b1 100644 --- a/lib/facter/application.rb +++ b/lib/facter/application.rb @@ -85,7 +85,7 @@ module Facter begin require 'rdoc/ri/ri_paths' require 'rdoc/usage' - puts RDoc.usage + RDoc.usage # print usage and exit rescue LoadError $stderr.puts "No help available unless your RDoc has RDoc.usage" exit(1) diff --git a/lib/facter/id.rb b/lib/facter/id.rb index c2ab3b7..c2c3594 100644 --- a/lib/facter/id.rb +++ b/lib/facter/id.rb @@ -1,5 +1,5 @@ Facter.add(:id) do - confine :operatingsystem => %w{Linux Fedora RedHat CentOS SuSE SLES Debian Ubuntu Gentoo AIX OEL OVS GNU/kFreeBSD} + confine :operatingsystem => %w{Linux Fedora RedHat CentOS SuSE SLES Debian Ubuntu Gentoo AIX OEL OVS GNU/kFreeBSD windows} setcode "whoami" end diff --git a/lib/facter/ipaddress.rb b/lib/facter/ipaddress.rb index 08a5dc8..d563408 100644 --- a/lib/facter/ipaddress.rb +++ b/lib/facter/ipaddress.rb @@ -47,7 +47,7 @@ Facter.add(:ipaddress) do output.split(/^\S/).each { |str| if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 - unless tmp =~ /^127\./ + unless tmp =~ /^127\./ or tmp == "0.0.0.0" ip = tmp break end diff --git a/lib/facter/lsb.rb b/lib/facter/lsb.rb index 4b98466..bf4b9db 100644 --- a/lib/facter/lsb.rb +++ b/lib/facter/lsb.rb @@ -22,13 +22,13 @@ Facter.add(fact) do confine :kernel => [ :linux, :"gnu/kfreebsd" ] setcode do - unless defined?(@@lsbdata) and defined?(@@lsbtime) and (Time.now.to_i - @@lsbtime.to_i < 5) + unless defined?(lsbdata) and defined?(lsbtime) and (Time.now.to_i - lsbtime.to_i < 5) type = nil - @@lsbtime = Time.now - @@lsbdata = Facter::Util::Resolution.exec('lsb_release -a 2>/dev/null') + lsbtime = Time.now + lsbdata = Facter::Util::Resolution.exec('lsb_release -a 2>/dev/null') end - if pattern.match(@@lsbdata) + if pattern.match(lsbdata) $1 else nil diff --git a/lib/facter/util/virtual.rb b/lib/facter/util/virtual.rb index 129448e..06b1b6d 100644 --- a/lib/facter/util/virtual.rb +++ b/lib/facter/util/virtual.rb @@ -60,8 +60,8 @@ module Facter::Util::Virtual def self.jail? path = case Facter.value(:kernel) - when "FreeBSD": "/sbin" - when "GNU/kFreeBSD": "/bin" + when "FreeBSD" then "/sbin" + when "GNU/kFreeBSD" then "/bin" end Facter::Util::Resolution.exec("#{path}/sysctl -n security.jail.jailed") == "1" end diff --git a/lib/facter/util/vlans.rb b/lib/facter/util/vlans.rb index 6d226ff..2b2a72f 100644 --- a/lib/facter/util/vlans.rb +++ b/lib/facter/util/vlans.rb @@ -12,7 +12,7 @@ module Facter::Util::Vlans def self.get_vlans vlans = Array.new if self.get_vlan_config - self.get_vlan_config.each do |line| + self.get_vlan_config.each_line do |line| if line =~ /^([0-9A-Za-z]+)\.([0-9]+) / vlans.insert(-1, $~[2]) if $~[2] end @@ -21,4 +21,4 @@ module Facter::Util::Vlans vlans.join(',') end -end +end |
