summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2015-07-09 13:35:27 -0700
committerClaire McQuin <claire@getchef.com>2015-07-21 09:47:50 -0700
commit68506520e8962ae685a551bfb3594272c68d31f0 (patch)
tree21860f72dd4e0ba562e56aacfe82a5367c022015 /lib
parent542eebb54f20bde83612cff37ea1d7156ca0ffd1 (diff)
downloadohai-68506520e8962ae685a551bfb3594272c68d31f0.tar.gz
Use Ohai.config
Diffstat (limited to 'lib')
-rw-r--r--lib/ohai/application.rb8
-rw-r--r--lib/ohai/config.rb2
-rw-r--r--lib/ohai/dsl/plugin.rb2
-rw-r--r--lib/ohai/hints.rb2
-rw-r--r--lib/ohai/loader.rb4
-rw-r--r--lib/ohai/system.rb4
6 files changed, 11 insertions, 11 deletions
diff --git a/lib/ohai/application.rb b/lib/ohai/application.rb
index 264df0f2..4388fdf7 100644
--- a/lib/ohai/application.rb
+++ b/lib/ohai/application.rb
@@ -82,8 +82,8 @@ class Ohai::Application
end
def configure_logging
- Ohai::Log.init(Ohai::Config[:log_location])
- Ohai::Log.level = Ohai::Config[:log_level]
+ Ohai::Log.init(Ohai.config[:log_location])
+ Ohai::Log.level = Ohai.config[:log_level]
end
def run_application
@@ -103,12 +103,12 @@ class Ohai::Application
# Log a fatal error message to both STDERR and the Logger, exit the application
def fatal!(msg, err = -1)
STDERR.puts("FATAL: #{msg}")
- Chef::Log.fatal(msg)
+ Ohai::Log.fatal(msg)
Process.exit err
end
def exit!(msg, err = -1)
- Chef::Log.debug(msg)
+ Ohai::Log.debug(msg)
Process.exit err
end
end
diff --git a/lib/ohai/config.rb b/lib/ohai/config.rb
index 988c2328..1e8404c1 100644
--- a/lib/ohai/config.rb
+++ b/lib/ohai/config.rb
@@ -34,7 +34,7 @@ module Ohai
# otherwise they will get method_missing'd to nil.
private
def self.default_hints_path
- [ platform_specific_path('/etc/chef/ohai/hints') ]
+ [ ChefConfig::Config.platform_specific_path('/etc/chef/ohai/hints') ]
end
def self.default_plugin_path
diff --git a/lib/ohai/dsl/plugin.rb b/lib/ohai/dsl/plugin.rb
index 86ccc622..48048910 100644
--- a/lib/ohai/dsl/plugin.rb
+++ b/lib/ohai/dsl/plugin.rb
@@ -92,7 +92,7 @@ module Ohai
def run
@has_run = true
- if Ohai::Config[:disabled_plugins].include?(name)
+ if Ohai.config[:disabled_plugins].include?(name)
Ohai::Log.debug("Skipping disabled plugin #{name}")
else
run_plugin
diff --git a/lib/ohai/hints.rb b/lib/ohai/hints.rb
index c8b0bc1b..603a1e46 100644
--- a/lib/ohai/hints.rb
+++ b/lib/ohai/hints.rb
@@ -29,7 +29,7 @@ module Ohai
@hints ||= Hash.new
return @hints[name] if @hints[name]
- Ohai::Config[:hints_path].each do |path|
+ Ohai.config[:hints_path].each do |path|
filename = File.join(path, "#{name}.json")
if File.exist?(filename)
begin
diff --git a/lib/ohai/loader.rb b/lib/ohai/loader.rb
index 44c77321..1c7519df 100644
--- a/lib/ohai/loader.rb
+++ b/lib/ohai/loader.rb
@@ -24,7 +24,7 @@ require 'pathname'
module Ohai
# Ohai plugin loader. Finds all the plugins in your
- # `Ohai::Config[:plugin_path]` (supports a single or multiple path setting
+ # `Ohai.config[:plugin_path]` (supports a single or multiple path setting
# here), evaluates them and returns plugin objects.
class Loader
@@ -57,7 +57,7 @@ module Ohai
# Searches all plugin paths and returns an Array of PluginFile objects
# representing each plugin file.
def plugin_files_by_dir
- Array(Ohai::Config[:plugin_path]).inject([]) do |plugin_files, plugin_path|
+ Array(Ohai.config[:plugin_path]).inject([]) do |plugin_files, plugin_path|
plugin_files + PluginFile.find_all_in(plugin_path)
end
end
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb
index 5df6c7f9..c98ac1af 100644
--- a/lib/ohai/system.rb
+++ b/lib/ohai/system.rb
@@ -49,8 +49,8 @@ module Ohai
@v6_dependency_solver = Hash.new
# configure logging
- Ohai::Log.init(Ohai::Config[:log_location])
- Ohai::Log.level = Ohai::Config[:log_level]
+ Ohai::Log.init(Ohai.config[:log_location])
+ Ohai::Log.level = Ohai.config[:log_level]
@loader = Ohai::Loader.new(self)
@runner = Ohai::Runner.new(self, true)