summaryrefslogtreecommitdiffstats
path: root/lib/puppet/transaction.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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!'.
| * Fixing #976 -- both the full name of qualified classes andLuke Kanies2008-01-191-1/+1
| | | | | | | | | | | | the class parts are now added as tags. I've also created a Tagging module that we should push throughout the rest of the system that uses tags.
* | Fixing automatic relationships. I was previously looking themLuke Kanies2008-01-141-1/+1
| | | | | | | | | | up in the relationship graph, which only stores the vertices, not the resource table.
* | Another round of fixes toward making global resources work.Luke Kanies2008-01-091-1/+1
|/ | | | | | The only remaining failures are more complicated ones (which I'll need to not be on a plane to debug, for battery reasons) or those related to the broken directory_service providers.
* Renaming 'configuration' to 'catalog', fixing #954.Luke Kanies2007-12-111-13/+13
|
* Fixing #800 by refactoring how configurations are retrievedLuke Kanies2007-11-121-1/+1
| | | | | | | | | from the server. The real problem was getting all of the validation done before any caching, which required a good bit more refactoring than I expected. In actuality, this commit is relatively small even though it covers many files; most of the changes just make the code clearer or shorter.
* Switching the graph base class from GRATR::DigraphLuke Kanies2007-11-071-2/+2
| | | | | | to Puppet::SimpleGraph, which should dramatically enhance performance. It should be largely functionally equivalent, with the only difference being that edges are no longer deduplicated.
* The configurations should now be functional again --Luke Kanies2007-10-311-6/+1
| | | | | | | | | | file recursion was previously not working, because the relationship graph was setting itself as a resource's primary configuration, which caused it to try creating its own relationship graph. I've now found that the current code is about 5x slower than the released code, so now I hope to resolve that.
* Fixing #817, mostly using the patch by DavidS. I couldLuke Kanies2007-10-031-0/+10
| | | | | not directly use the patch because I have refactored too much.
* Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
|
* All tests now pass in this configuration branch, which meansLuke Kanies2007-09-221-3/+6
| | | | | | | | it's time to merge it back into the indirection branch. Considering that this work was what drove me to create the indirection branch in the first place, i should now be able to merge both back in the master branch.
* The structure for handling resource generation is nowLuke Kanies2007-09-221-1/+2
| | | | | | | | | | in place, which means I'm over the hump in developing this branch. I have to fix some design flaws I made in the configurations, particularly that the 'runner' handler needs to be able to specify tags and whether to ignore schedules, but otherwise, I think it's straightforward test- and bug-fixing from here out.
* This is basically another intermediate commit. I feel likeLuke Kanies2007-09-171-71/+18
| | | | | | | | | | | | | | | | | | | | I've gone too far down the rabbit hole to turn back now, but the code is clearly getting more centralized around the Configuration class, which is the goal. Things are currently a bit muddy between recursion, dynamic resource generation, transactions, and the configuration, and I don't expect to be able to clear it up much until we rewrite all of the tests for the Transaction class, since that is when we'll actually be setting its behaviour. At this point, Files (which are currently the only resources that generate other resources) are responsible for adding their edges to the relationship graph. This puts them knowing more than I would like about how the relationship graph works, but it'll have to do for now. There are still failing tests, but files seem to work again. Now to go through the rest of the tests and make them work.
* The whole system now uses Configuration objects instead ofLuke Kanies2007-09-151-28/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ever converting the Transportable objects into a tree of components and then converting that into a graph. This is a significant step, and drastically simplifies the model of how to use a configuration. The old code might have looked something like this: file = Puppet::Type.create :path => "/whatever", ... comp = Puppet::Type.create :name => :whatever comp.push file transaction = comp.evaluate transaction.evaluate The new code looks like this: file = Puppet::Type.create :path => "/whatever", ... config = Puppet::Node::Configuration.new config.add_resource file config.apply I did not really intend to do this much refactoring, but I found I could not use a Configuration object to do work without refactoring a lot of the system. The primary problem was that the Client::Master and the Config classes determined how the transactions behaved; when I moved to using a Configuration, this distinction was lost, which meant that configurations were often needing to create other configurations, which resulted in a whole lot of infinite recursion (e.g., Config objects that create directories for Puppet use Configuration objects -- yes, I'm s/Config/Settings/g soon -- and these Configuration objects would need to create directories). Not everything is fixed, but it's very close. I am clearly over the hump, though, so I wanted to get a commit in.
* Fixing transactions so that they do not flush resources that are in noopluke2007-07-111-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2678 980ebf18-57e1-0310-9a29-db15c13687c0
* Cleaning up a log message in the transactionluke2007-07-101-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2672 980ebf18-57e1-0310-9a29-db15c13687c0
* Changing "element" to "resource" in the documentation, which just aligns ↵luke2007-07-091-1/+1
| | | | | | with a terminology change we made almost a year ago. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2665 980ebf18-57e1-0310-9a29-db15c13687c0