lib/onering/plugins/reporter.rb in onering-client-0.0.34 vs lib/onering/plugins/reporter.rb in onering-client-0.0.35

- old
+ new

@@ -41,37 +41,20 @@ rescue Gem::LoadError next end end - # attempt to load things begin - require 'rubygems' - rescue - nil - end - - begin - require 'ohai' - Ohai::Config[:plugin_path] << '/etc/chef/ohai_plugins' - @ohai = Ohai::System.new - @ohai.all_plugins - rescue LoadError - @ohai = nil - end - - begin ENV['FACTERLIB'] = @facter_path.join(':') require 'facter' - @facter = Facter rescue LoadError - @facter = nil + STDERR.puts("Unable to load Facter library") end end def fact(name, default=nil) - if @facter + if defined?(Facter) return (Facter.value(name) or default) end return nil end \ No newline at end of file