Class: Chef::Application::Solo

Inherits:
Chef::Application show all
Defined in:
lib/chef/application/solo.rb

Instance Method Summary collapse

Methods inherited from Chef::Application

#configure_chef, #configure_logging, debug_stacktrace, exit!, fatal!, #run

Constructor Details

#initializeSolo

Returns a new instance of Solo.



94
95
96
97
# File 'lib/chef/application/solo.rb', line 94

def initialize
  super
  @chef_solo = nil
end

Instance Method Details

#reconfigureObject



99
100
101
# File 'lib/chef/application/solo.rb', line 99

def reconfigure
  super
end

#run_applicationObject



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/chef/application/solo.rb', line 106

def run_application
  loop do
    begin
      if Chef::Config[:splay]
        splay = rand Chef::Config[:splay]
        Chef::Log.debug("Splay sleep #{splay} seconds")
        sleep splay
      end

      @chef_solo = Chef::Client.new
      @chef_solo.run
      @chef_solo = nil
      Chef::Application.exit! "Exiting", 0
    rescue SystemExit => e
      raise
    rescue Exception => e
      Chef::Application.debug_stacktrace(e)
      Chef::Application.fatal!("#{e.class}: #{e.message}", 1)
    ensure
      GC.start
    end
  end
end

#setup_applicationObject



103
104
# File 'lib/chef/application/solo.rb', line 103

def setup_application
end