summaryrefslogtreecommitdiffstats
path: root/lib/puppet/transaction.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Adding tracing to prefetch failures, and Fixing the environment support in ↵luke2007-06-181-0/+3
| | | | | | the cron type (#669). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2621 980ebf18-57e1-0310-9a29-db15c13687c0
* Finishing off the type/provider interface work, including adding package ↵luke2007-06-081-0/+1
| | | | | | prefetch for all packages. The only not-done one is yum -- prefetch is set up for rpm, but not yum. We need to modify prefetching so that it also prefetches latest information, to avoid having to run yum so many times. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2555 980ebf18-57e1-0310-9a29-db15c13687c0
* Significantly reworked the type => provider interface with respect toluke2007-06-041-9/+13
| | | | | | | | | | | | | | | | | | | | listing existing provider instances. The class method on both class heirarchies has been renamed to 'instances', to start. Providers are now expected to return provider instances, instead of creating resources, and the resource's 'instances' method is expected to find the matching resource, if any, and set the resource's provider appropriately. This *significantly* reduces the reliance on effectively global state (resource references in the resource classes). This global state will go away soon. Along with this change, the 'prefetch' class method on providers now accepts the list of resources for prefetching. This again reduces reliance on global state, and makes the execution path much easier to follow. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2551 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #507 (behaviour in cycles) by changing the topsort algorithm.luke2007-05-171-3/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2521 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #607 -- parameters and properties now refer to a @resource rather ↵luke2007-05-091-2/+2
| | | | | | than a @parent. The @parent parameter is still set for now, for backward compatibility. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2500 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging of refactor-transacton to the trunk. This work removes the :is ↵ballman2007-05-091-1/+1
| | | | | | attribute from properties and relies on the provider to cache or return the current value of the property. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2487 980ebf18-57e1-0310-9a29-db15c13687c0