lib/puppet/agent.rb
# Perform a run with our client.
Perform a run with our client.
Perform a run with our client .
def run(client_options = {})
    if running?
      Puppet.notice "Run of #{client_class} already in progress; skipping  (#{lockfile_path} exists)"
      return
    end
    if disabled?
      Puppet.notice "Skipping run of #{client_class}; administratively disabled (Reason: '#{disable_message}');\nUse 'puppet agent --enable' to re-enable."
      return
    end
    result = nil
    block_run = Puppet::Application.controlled_run do
      splay client_options.fetch :splay, Puppet[:splay]
      result = run_in_fork(should_fork) do
        with_client do |client|
          begin
            client_args = client_options.merge(:pluginsync => Puppet[:pluginsync])
            sync.synchronize { lock { client.run(client_args) } }
          rescue SystemExit,NoMemoryError
            raise
          rescue Exception => detail
            Puppet.log_exception(detail, "Could not run #{client_class}: #{detail}")
          end
        end
      end
      true
    end
    Puppet.notice "Shutdown/restart in progress (#{Puppet::Application.run_status.inspect}); skipping run" unless block_run
    result
  end
def run ( client_options = { } ) if running? Puppet . notice "Run of #{client_class} already in progress; skipping  (#{lockfile_path} exists)" return end if disabled? Puppet . notice "Skipping run of #{client_class}; administratively disabled (Reason: '#{disable_message}');\nUse 'puppet agent --enable' to re-enable." return end result = nil block_run = Puppet :: Application . controlled_run do splay client_options . fetch :splay , Puppet [ :splay ] result = run_in_fork ( should_fork ) do with_client do | client | begin client_args = client_options . merge ( :pluginsync => Puppet [ :pluginsync ] ) sync . synchronize { lock { client . run ( client_args ) } } rescue SystemExit , NoMemoryError raise rescue Exception => detail Puppet . log_exception ( detail , "Could not run #{client_class}: #{detail}" ) end end end true end Puppet . notice "Shutdown/restart in progress (#{Puppet::Application.run_status.inspect}); skipping run" unless block_run result end
Perform a run with our client.
Perform a run with our client .
client_options
<not_specific>