summaryrefslogtreecommitdiffstats
path: root/lib/puppet/agent.rb
Commit message (Collapse)AuthorAgeFilesLines
* Feature #3394 REST Runner, preparationJesse Wolfe2010-02-171-2/+0
| | | | Rename Puppet::Agent::Runner to Puppet::Run, for consistency
* Fix 2239 (step three): Refactored Puppet::Agent to base starting/restarting ↵Ethan Rowe2010-02-171-45/+15
| | | | behaviors and predicates on new run-status interface of Puppet::Application.
* Merge branch '0.25.x'Markus Roberts2010-02-091-0/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/agent.rb lib/puppet/application/puppet.rb lib/puppet/configurer.rb man/man5/puppet.conf.5 spec/integration/defaults.rb spec/unit/configurer.rb
| * Partial reversion of patch for #3088 to fix #3104 (Exception misreported)Markus Roberts2010-01-241-2/+2
| | | | | | | | | | | | | | In my patch for #3088 I made a erroneous assumption about the ruby exception hierarchy and thus missed the fact that Timeout::error descends from both SignalError and Interrupt. This is a partial reversion of the patch for #3088 to let these through so that more useful error messages can be produced.
| * Fix for #3088 (catching Exception also traps SystemExit)Markus Roberts2010-01-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Changing rescues from the default to Exception (to catch errors that don't descend from StandardError) had the unintended consequence of catching (and suppressing) SystemExit. This patch restores the behavior of by reraising the exception. Of the other exceptions that fall through the same crack (NoMemoryError, SignalException, LoadError, Interrupt, NotImplementedError, and ScriptError) this patch also reraises NoMemoryError, SignalException, and Interrupt in the same way and leaves the rest captured.
* | Merge branch '0.25.x'Luke Kanies2009-12-211-2/+2
|\| | | | | | | | | | | | | | | Conflicts: lib/puppet/agent.rb lib/puppet/application/puppetd.rb lib/puppet/parser/ast/leaf.rb lib/puppet/util/rdoc/parser.rb
| * Fix for #2661 and related issuesMarkus Roberts2009-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If setup code for a process depends on network connectivity it needs to be protected with a rescue clause as much as the main body of the process. Further, Timeout exceptions aren't under StandardError and thus aren't caught by an un-typed rescue clause. This doesn't matter if we've morphed the exception, but will cause the program to fail if we haven't. There are many places where these concerns _might_ cause a problem but in most cases they never will in practice; this patch addresses the five cases where I have been able to confirm that it actually can cause the client daemon to exit and two more where I suspect (but can not prove) that it could. This is an extension of the prior patch to cover additional cases found by automated testing (repeated catalog runs with a 1% chance of timeout forced on all timeout-bound operations, ~5000 runs). The new cases recurred multiple times (>100 each) and in a final pass with these corrected (~2500 runs) no additional cases were found.
* | Fix #1934 - detailed-exitcodes for puppetdDeepak Giridharagopal2009-11-191-1/+3
|/ | | | | | | | | | | | | | | | | | | | | | This option only works when --onetime is specified, as it doesn't make much sense to worry about exit codes in the context of a long-running daemon. This required a refactoring of the existing --detailed-exitcodes code, as "puppetd" wasn't directly creating a transaction object (like "puppet" does). Added Report::exit_status, which did what was previously hard-coded into the "puppet" executable. An Agent's "run" method now returns a value (the result of the individual client class' "run" method) The "puppetd" agent's "run" method now returns a transaction report, as that seems like the logical thing to return as the result of applying a catalog. Signed-off-by: Deepak Giridharagopal <deepak@brownman.org>
* Ticket #2676 (a typo)Markus Roberts2009-09-251-2/+2
| | | | | | Signed-off-by: Markus Roberts <Markus@reality.com> Signed-off-by: Markus Roberts <Markus@reality.com>
* Fixing the Agent so puppetrun actually works server-sideLuke Kanies2009-05-271-2/+2
| | | | | | | We weren't correctly propagating options through to the Configurer instance. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding an Agent::Runner class.Luke Kanies2009-02-061-0/+2
| | | | | | | This will eventually be used by puppetrun, but for now is just called by the old-school Runner handler. Signed-off-by: Luke Kanies <luke@madstop.com>
* The Agent now uses its lockfile to determine running stateLuke Kanies2009-02-061-6/+1
| | | | | | | | This makes it so we can easily create and use lots of agent instances, rather than having a single global instance with shared state. Signed-off-by: Luke Kanies <luke@madstop.com>
* Creating and using a new Puppet::Daemon classLuke Kanies2009-02-061-14/+25
| | | | | | | | | | | | This replaces the short-lived EventManager class, all of the service- and timer-related code in puppet.rb, and moves code from agent.rb, server.rb, and other places into one class responsible for starting, stopping, pids, and more. The Daemon module is no longer in existence, so it's been removed from the classes that were using it. Signed-off-by: Luke Kanies <luke@madstop.com>
* Splitting the Agent class into Agent and ConfigurerLuke Kanies2009-02-061-168/+81
| | | | | | | | | | | | Once I went to add runinterval support to the Agent class, I realized it's really two classes: One that handles starting, stopping, running, et al (still called Agent), and one that handles downloading the catalog, running it, etc. (now called Configurer). This commit includes some additional code, but 95% of it is just moving code around. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing obsolete code and tests for the agent.Luke Kanies2009-02-061-89/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Converting the catalog as neededLuke Kanies2009-02-061-11/+19
| | | | | | | Converting to a Resource catalog for transmission, then converting to a RAL catalog on the client. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving the Agent locking code to a module.Luke Kanies2009-02-061-38/+18
| | | | | | | Also cleaning up the lock usage by yielding to a block when a lock is attained. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving classfile-writing to the CatalogLuke Kanies2009-02-061-19/+2
| | | | | | | | This work was done by the Agent class before, but it's really related to the catalog, so that's where it is now. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving fact and plugin handling into modulesLuke Kanies2009-02-061-263/+77
| | | | | | | | | | This doesn't change functionality, it just simplifies the agent class. I've also started the work to get the catalog handling done using REST/the Indirector. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing the Agent code that added client-side factsLuke Kanies2009-02-061-9/+0
| | | | | | It's now moved to the Facter indirector terminus. Signed-off-by: Luke Kanies <luke@madstop.com>
* Renmaing Puppet::Network::Client::Master to Puppet::AgentLuke Kanies2009-02-061-0/+526
| | | | | | | | | Made minor changes, including removing the parent class. The functionality hasn't changed yet -- that comes in later patches -- but all but a couple of the older tests pass. Signed-off-by: Luke Kanies <luke@madstop.com>
* Revert "Adding the first bits of an Agent class."Luke Kanies2009-02-061-107/+0
| | | | This reverts commit bbd99cc87a775732f2fed3686962647a5c30c5b8.
* Revert "This is work that I've decided not to keep"Luke Kanies2009-02-061-390/+39
| | | | This reverts commit f57a5e88229578747dde2c90af3a696ad0172e72.
* This is work that I've decided not to keepLuke Kanies2009-02-061-39/+390
| | | | | | | so I'm just applying it here so it continues to show up in the history in case I ever want to look at it again. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding the first bits of an Agent class.Luke Kanies2009-02-061-0/+107
This class replaces the existing, all-knowing Client::Master class, and it will hopefully be more reasonable in scope. Signed-off-by: Luke Kanies <luke@madstop.com>