summaryrefslogtreecommitdiffstats
path: root/lib/puppet/transaction.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix for #3690 failing to calculate error codesJesse Wolfe2010-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | This failure was getting caused by what I believe to be a bug in Puppet::Configurer where it always generated a new Puppet::Transaction::Report, even if one existed in an outer scope. In puppetd --test, a different Report was getting queried to generate the exit status than the one that was passed to the transaction -- this Report had no Metrics and would fail when queried. This obscured a second bug that Metrics could return nil for values if the Transaction had applied an empty Catalog, but Transaction::Report assumes that values will always be integers. It could be argued that an empty Report should be populated with empty Metrics before a Transaction is run, which would have prevented Report#exit_status from raising an exception ... which would have made these bugs much harder to track down. So, I've decided to leave that unchanged. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fixing #3533 - Removing all transaction cleanupLuke Kanies2010-02-171-8/+0
| | | | | | | | | | It's really slow and has no actual functionality any more, since we just remove the catalogs from memory anyway. This should be a good speed boost for very little effort. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fix 2239 (step five): introduce new Puppet::Transaction#stop_processing? ↵Ethan Rowe2010-02-171-0/+7
| | | | flag and associated check thereof within the resource evaluation code. This should allow for the transaction to bail out of its processing if it finds that a stop has been requested, based on the state of Puppet::Application.stop_requested?.
* Allow skipped resources to process eventsJesse Wolfe2010-02-171-3/+2
|
* Generated resources' events are actually bound to the resource thatJesse Wolfe2010-02-171-8/+8
| | | | generated them.
* Changing the method profile of EventManager#queue_eventLuke Kanies2010-02-171-3/+1
| | | | | | | It now takes multiple events instead of just one. This will help simplify a bunch of performance optimizations. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Moving Metric management to the reportsLuke Kanies2010-02-171-76/+11
| | | | | | | | | | | | This is one less bit that the transaction does. The resource status objects had nearly enough information to do everything, so I just added that last bit, and moved everything over. It's all much cleaner now. I had to change some existing, internal APIs, but mostly this should be hidden from outside users. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Removing mention of @changes in TransactionLuke Kanies2010-02-171-48/+2
| | | | | | This is handled in the Status instances now. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing #2759 - reports now have complete change infoLuke Kanies2010-02-171-4/+2
| | | | | | | | This includes every event generated in the transaction and a Resource::Status object for each resource managed, with per-resource information in it. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Changing Transaction to use the new ResourceHarnessLuke Kanies2010-02-171-69/+53
| | | | | | | | | | | | This is a much messier commit than I would like, mostly because of how 'file' works. I had to fix multiple special cases, and I had to move others. The whole system appears to now work, though, and we're ready to change reports to receive resource status instances rather than events. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Removing last event collection transaction codeLuke Kanies2010-02-171-13/+18
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Correcting comments and making report timestamp internalLuke Kanies2010-02-171-9/+2
| | | | | | | | | We had some no-longer-correct comments in the Transaction class, which are now removed. This also moves the timestamp for reports into the report class, so it's created at initialization by the report, rather than by the transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
* Extracting event management into a separate classLuke Kanies2010-02-171-84/+16
| | | | | | | | | | Thus pulls all event-related code out of Transaction. The Transaction class currently creates a single instance of this class, so it's nowhere near a "real" event manager, but at least it has very clean integration points and will be easy to upgrade as needed. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving event creation to the resourceLuke Kanies2010-02-171-3/+4
| | | | | | | | This allows the Transaction class to reuse the event creation code when it creates noop and restart events. Signed-off-by: Luke Kanies <luke@madstop.com>
* Random code cleanupLuke Kanies2010-02-171-33/+17
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Switching transactions to callback-based eventsLuke Kanies2010-02-171-200/+119
| | | | | | | | | | | | | Events are now queued as they are created, and the queues are managed through simple interfaces, rather than collecting events over time and responding to them inline. This drastically simplifies event management, and will make moving it to a separate system essentially trivial. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1054 - transaction reports are always sentLuke Kanies2010-01-181-59/+20
| | | | | | | | | | | | | This refactors how reports, catalogs, configurers, and transactions are all related - the Configurer class manages the report, both creating and sending it, so the transaction is now just responsible for adding data to it. I'm still a bit uncomfortable of the coupling between transactions, the report, and configurer, but it's better than it was. This also fixes #2944 and #2973. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing some unneeded validation code from Transaction.newLuke Kanies2010-01-181-8/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2789 puppetrun fails without --tagJesse Wolfe2009-11-191-10/+9
| | | | | | | | | Puppet::Transaction was handling "tags" strings differently depending on whether they came in from Puppet[:tags] or another source. This was causing puppetrun's tags to be misparsed if there was not exactly one --tag parameter. I've moved the code to Util::Tagging.
* Fixing 2806 Specifying multiple tags fails to apply any of themJesse Wolfe2009-11-131-2/+5
| | | | | | | | | Fix code that was passing an Array of code to a method that was expecting a single tag. Includes Markus's suggestions Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fix #2797 - tags are not inherited by recursed file sub childBrice Figureau2009-11-121-0/+1
| | | | | | | | | | | | This problem affects all types that generate sub-resources at evaluation or pre-transaction time. Thus it is fixed in the transaction, where we make sure we assign all parent tags to the generated child resource. A more correct fix would be to make sure we copy the whole context (ie file, line, version, tags). This fix is planned for Rowlf. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2507 - Exported resources were not correctly collected.Brice Figureau2009-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | #2507 contains two issues: * a crash when we filters-out an unwanted resource which had edges pointing to it. * resources are losing their virtuality when they are transformed from Puppet::Parser::Resource to Puppet::Resource. This means we weren't able to distinguish anymore between an exported resource collected in the same node as it was exported and an exported resource collected in another node. The net result is that we can't apply exported resources that are collected in the same node because they are filtered out by the catalog filter (see the commits for #2391 for more information). The fix is to keep the virtuality of the resources so that we can differentiate those two types of exported resources. We keep this until the catalog is ready to be sent, where we filter out the virtual resouces only, the other still exported ones needs to be sent to the client. To be real sure, the transaction also skips virtual resources. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Logging the configuration version we're applyingLuke Kanies2009-08-011-0/+2
| | | | | | | This is just an additional info log in the transaction, and is only done if the version is non-nil. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2399 - removing client-side rrd graphsLuke Kanies2009-07-231-4/+0
| | | | | | | | This feature has been broken since who knows when, yet no one's noticed. Thus, it's a good candidate for removal. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2391 - Exported resources never make to the storeconfigs dbBrice Figureau2009-07-181-0/+2
| | | | | | | | | | | | | | | | | | The issue is that when we convert Puppet::Parser::Resource catalog to a Puppet::Resource catalog before storing it to the database, we don't allow virtual resource to be converted. Unfortunately exported resources are virtual by design, and as such aren't converted, and we lose them, so it isn't possible to store them in the database. Unfortunately, the client will get the exported resources too. The fix is dual-fold: * we make sure exported resource are skipped when the transaction is applied as a last safeguard * we filter-out the catalog through the catalog compiler terminus before the catalog is returned to the client Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-26/+26
|
* Fixing #2253 - pluginsync failures propagate correctlyLuke Kanies2009-05-261-8/+8
| | | | | | | | | | | This keeps the destination directory from getting purged if the remote source is invalid. This mostly just removes an optimization that worked fine when we queried the server for every directory, but doesn't work now that we do one big query. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring resource generation slightlyLuke Kanies2009-05-261-5/+4
| | | | | | | | | | | I found some cases where duplicate resources weren't correctly skipped, but I couldn't get the test to really demonstrate them. The code at least is demonstrated to work, anyway. Signed-off-by: Luke Kanies <luke@madstop.com>
* Extracting a method from eval_resource in TransactionLuke Kanies2009-05-261-37/+45
| | | | | | Just cleaning up the code a bit before a modification. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2273 - file purging works more intuitivelyLuke Kanies2009-05-201-0/+1
| | | | | | | | | | | | | | It now correctly purges files whether we're recursing locally or remotely. *Please* test various scenarios you can think of with this. I've tested: * Local recursion with no remote source * Remote recursion with a source * Recursion with an extra locally managed file Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2112 - Transactions handle conflicting generated resourcesLuke Kanies2009-04-171-2/+8
| | | | | | | | | | This commit rips out all of the 'implicit resource' crap, replacing it with a simple system that just skips resources that the catalog says are in conflict. Removes a bunch of code, and fixes the bug to boot. Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x'Luke Kanies2009-04-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/ralsh lib/puppet/executables/client/certhandler.rb lib/puppet/parser/functions/versioncmp.rb lib/puppet/parser/resource/reference.rb lib/puppet/provider/augeas/augeas.rb lib/puppet/provider/nameservice/directoryservice.rb lib/puppet/provider/ssh_authorized_key/parsed.rb lib/puppet/type.rb lib/puppet/type/file/checksum.rb spec/integration/defaults.rb spec/integration/transaction/report.rb spec/unit/executables/client/certhandler.rb spec/unit/indirector/ssl_rsa/file.rb spec/unit/node/catalog.rb spec/unit/provider/augeas/augeas.rb spec/unit/rails.rb spec/unit/type/ssh_authorized_key.rb spec/unit/type/tidy.rb test/executables/filebucket.rb test/executables/puppetbin.rb
| * Fixing #2013 - prefetching had a mismatch between type and titleLuke Kanies2009-03-041-1/+1
| | | | | | | | | | | | | | | | | | The ParsedFile types seem to be the main one that suffers from this, but the transactions were using the resource titles, not names, so resources were often not getting prefetched correctly. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #1949 - relationships now use attributes instead of a labelLuke Kanies2009-03-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | This was important because the use of the label to store attributes was a holdover from the GRATR library, and if we didn't cease its use before we switched to RESTful catalogs, then we'd be stuck with the @label instance variable forever, essentially. Now we can add and remove variables however we please. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Some small fixes to provide better debugging and load a libraryLuke Kanies2009-02-181-0/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Renaming Puppet::Node::Catalog to Puppet::Resource::CatalogLuke Kanies2008-12-181-1/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fix #1483 - use REST to transmit reports over the wireBrice Figureau2008-12-061-11/+1
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Finishing the refactoring of the resource generation interface.Luke Kanies2008-11-071-9/+4
| | | | | | | | | | | | | | All of the code works, and there are integration tests all around to prove it. I think. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Refactoring and clarifying the resource generation methods.Luke Kanies2008-11-071-45/+21
| | | | | | | | | | | | It now works with the new Catalog#add_resource method. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Removing the PGraph class and subsuming it into SimpleGraph.Luke Kanies2008-11-061-2/+2
| | | | | | | | | | | | | | This class is a holdover from when I was using GRATR, and it's obsolete now. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-07-041-14/+7
|\| | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/util/settings.rb spec/integration/defaults.rb spec/unit/node/catalog.rb spec/unit/type/interface.rb spec/unit/type/ssh_authorized_key.rb
| * Removing the Transaction::Change#transaction accessor.Luke Kanies2008-07-041-1/+0
| | | | | | | | | | | | | | As with Events, this was never used (beyond being assigned), so I've gotten rid of it. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Refactoring the Transaction::Event class.Luke Kanies2008-07-041-12/+4
| | | | | | | | | | | | | | | | | | | | | | The class had a 'transaction' accessor that was assigned but never used, and it is simple enough that it needed direct arguments rather than named arguments. The rest of the code is changing the other classes that use Events. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Renaming Puppet::Event to Puppet::Transaction::EventLuke Kanies2008-07-031-2/+4
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Renaming the Puppet::PropertyChange class to Puppet::Transaction::Change.Luke Kanies2008-07-031-1/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-05-251-2/+4
|\| | | | | | | | | | | | | Conflicts: CHANGELOG lib/puppet/transaction.rb
| * Fixing transaction support for prefetching generated resources.Luke Kanies2008-05-211-2/+4
| | | | | | | | | | | | Previously, we prefetched then generated, which caused generated resources that needed prefetching not to work. This just reorders the calls, so generated resources now get prefetched.
* | Merge branch 'master' into master_no_global_resourcesLuke Kanies2008-03-311-4/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/node/catalog.rb lib/puppet/type/pfile.rb lib/puppet/type/pfilebucket.rb lib/puppet/util/filetype.rb spec/unit/node/catalog.rb spec/unit/other/transbucket.rb spec/unit/ral/provider/mount/parsed.rb spec/unit/ral/types/file.rb spec/unit/ral/types/interface.rb spec/unit/ral/types/mount.rb spec/unit/ral/types/package.rb spec/unit/ral/types/schedule.rb spec/unit/ral/types/service.rb test/language/compile.rb test/language/lexer.rb test/language/snippets.rb test/lib/puppettest.rb test/ral/types/basic.rb test/ral/types/cron.rb test/ral/types/exec.rb test/ral/types/file.rb test/ral/types/file/target.rb test/ral/types/filebucket.rb test/ral/types/fileignoresource.rb test/ral/types/filesources.rb test/ral/types/group.rb test/ral/types/host.rb test/ral/types/parameter.rb test/ral/types/sshkey.rb test/ral/types/tidy.rb test/ral/types/user.rb test/ral/types/yumrepo.rb
| * Fixing #1110 -- transactions now always make sureLuke Kanies2008-02-291-2/+5
| | | | | | | | their tags are arrays.
| * Removing the last remaining vestiges of GRATR --Luke Kanies2008-02-111-1/+1
| | | | | | | | removing the bangs from 'add_vertex!' and 'add_edge!'.