# File lib/ohai/application.rb, line 116 def exit!(msg, err = -1) Chef::Log.debug(msg) Process.exit err end
Log a fatal error message to both STDERR and the Logger, exit the application
# File lib/ohai/application.rb, line 110 def fatal!(msg, err = -1) STDERR.puts("FATAL: #{msg}") Chef::Log.fatal(msg) Process.exit err end
# File lib/ohai/application.rb, line 64 def initialize super # Always switch to a readable directory. Keeps subsequent Dir.chdir() {} # from failing due to permissions when launched as a less privileged user. Dir.chdir("/") end
# File lib/ohai/application.rb, line 87 def configure_logging Ohai::Log.init(Ohai::Config[:log_location]) Ohai::Log.level = Ohai::Config[:log_level] end
# File lib/ohai/application.rb, line 78 def configure_ohai @attributes = parse_options Ohai::Config.merge!(config) if Ohai::Config[:directory] Ohai::Config[:plugin_path] << Ohai::Config[:directory] end end
# File lib/ohai/application.rb, line 72 def run configure_ohai configure_logging run_application end
# File lib/ohai/application.rb, line 92 def run_application ohai = Ohai::System.new if Ohai::Config[:file] ohai.from_file(Ohai::Config[:file]) else ohai.all_plugins end if @attributes.length > 0 @attributes.each do |a| puts ohai.attributes_print(a) end else puts ohai.json_pretty_print end end