diff options
author | Tim Smith <tsmith@chef.io> | 2018-09-14 10:47:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 10:47:20 -0700 |
commit | 1816d79cd1627d246df1151d368de9050e2c3065 (patch) | |
tree | e0c22ce3b600156de10e192e48284b5645337f6d | |
parent | 0b93c059806fd1e8c6643281a70e5598d5b43351 (diff) | |
parent | 2b5a6aac323463e6aa9fb726d9748685b1cd6554 (diff) | |
download | ohai-1816d79cd1627d246df1151d368de9050e2c3065.tar.gz |
Merge pull request #1241 from chef/fix_config
Fix providing relative paths to the config file
-rw-r--r-- | lib/ohai/application.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/ohai/application.rb b/lib/ohai/application.rb index dc16d111..2944dc16 100644 --- a/lib/ohai/application.rb +++ b/lib/ohai/application.rb @@ -69,14 +69,6 @@ class Ohai::Application proc: lambda { |v| puts "Ohai: #{::Ohai::VERSION}" }, exit: 0 - 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 - def run elapsed = Benchmark.measure do configure_ohai @@ -95,6 +87,10 @@ class Ohai::Application end def run_application + # Always switch to a readable directory. Keeps subsequent Dir.chdir() {} + # from failing due to permissions when launched as a less privileged user. + Dir.chdir("/") + config[:invoked_from_cli] = true config[:logger] = Ohai::Log.with_child ohai = Ohai::System.new(config) |