Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'puppet/application'
- require 'puppet/application/agent'
- class Puppet::Application::Unimatrix < Puppet::Application::Agent
- def onetime
- unless options[:client]
- $stderr.puts "onetime is specified but there is no client"
- exit(43)
- return
- end
- @daemon.set_signal_traps
- begin
- report = Puppet::Transaction::Report.new("unimatrix")
- Puppet[:report] = false
- @agent.run(:report => report)
- Puppet::Util::FileLocking.writelock(Puppet[:lastrunreport], 0660) do |file|
- file.print YAML.dump(report.to_yaml)
- end
- rescue => detail
- puts detail.backtrace if Puppet[:trace]
- Puppet.err detail.to_s
- end
- if not report
- exit(1)
- elsif options[:detailed_exitcodes] then
- exit(report.exit_status)
- else
- exit(0)
- end
- end
- end
Add Comment
Please, Sign In to add comment