diff options
-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 |
3 files changed, 8 insertions, 8 deletions
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 |