diff options
Diffstat (limited to 'lib/ohai/application.rb')
-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) |