summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/resource.rb
Commit message (Collapse)AuthorAgeFilesLines
* Modified the 'master' handler to use the Catalog class toLuke Kanies2008-04-111-0/+6
| | | | | | | | | | compile node configurations, rather than using the Configuration handler, which was never used directly. I removed the Configuration handler as a result. Modified the 'master' handler (responsible for sending configurations to clients) to always return Time.now as its compile date, so configurations will always get recompiled.
* Always duplicating resource defaults in the parser, so thatLuke Kanies2008-03-061-20/+17
| | | | | | stacked metaparameter values do not result in all resources that receive a given default also getting those stacked values.
* Fixing the fact that resources that model defined resourcesLuke Kanies2008-02-291-0/+7
| | | | | were getting finished multiple times, which meant they got multiple copies of metaparams.
* Fixing #1084 -- the node catalog asks the individualLuke Kanies2008-02-251-0/+9
| | | | | | resources whether they're isomorphic, and they in turn ask the resource types (or default to true for defined resource types).
* Converting the Compile class to use a Node::Catalog instanceLuke Kanies2008-02-111-1/+0
| | | | | as its resource container, instead of having its own behaviour around resource uniqueness.
* Moving all of the tests for Puppet::Parser::Compile toLuke Kanies2008-02-111-14/+0
| | | | | | rspec, so I can refactor the class to more heavily rely on a Node::Catalog instead of doing its own resource container management.
* More AST refactoring -- each of the code wrapping classesLuke Kanies2008-02-081-1/+1
| | | | | | | | | | | just returns a resource from its evaluate() method, and all of the work is done in the evaluate_code method. This makes the code cleaner, because it means 1) evaluate() has the same prototype as all of the other AST classes, 2) evaluate() is no longer called indirectly through the Parser Resource class, and 3) the classes themselves are responsible for creating the resources, rather than it being done in the Compile class.
* Refactoring the AST classes just a bit. I realized thatLuke Kanies2008-02-081-1/+1
| | | | | | all of the evaluate() methods only ever accepted a scope, and sometimes one other option, so I switched them all to use named arguments instead of a hash.
* Store a resource before adding relations to it otherwise activerecord willBart Vanbrabant2008-02-031-0/+2
| | | | complain. This fixes #933
* Fixing #976 -- both the full name of qualified classes andLuke Kanies2008-01-191-25/+10
| | | | | | 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.
* Theoretically, this patch is to fix #917 (which it does), butLuke Kanies2007-11-281-5/+5
| | | | | | | | | | | | | | | | | | | there were enough problems fixing it that I decided something more drastic needed to be done. This uses the new Puppet::ResourceReference class to canonize what a resource reference looks like and how to retrieve resources via their references. Specifically, it guarantees that resource types are always capitalized, even when they include '::' in them. While many files are modified in this commit, the majority of changes are quite small, and most of the changes are fixing the tests to use capitalized types. As we look at consolidating some of our resource types, we could consolidate the ResourceReference stuff at the same time, but at least the Puppet::Parser::ResourceReference class subclasses the main Puppet::ResourceReference class.
* Fixing a failing test from my fix for #446 -- I had changedLuke Kanies2007-11-191-6/+5
| | | | | | the behaviour of Resource#override_parameter unintentionally. I've corrected the comments so it's clear why the original behaviour was there.
* Fixing #446. I ended up largely not using porridge's patch,Luke Kanies2007-11-191-21/+34
| | | | | | but only because the code (and my coding style, to some extent) has changed so much in the last few months. Also, added specs.
* Successfully modified all tests and code so that all language tests pass ↵Luke Kanies2007-09-041-9/+25
| | | | again. This is the majority of the work necessary to make the separate "configuration" object work.
* We now have a real configuration object, as a subclass of GRATR::Digraph, ↵Luke Kanies2007-09-041-4/+18
| | | | that has a resource graph including resources for the container objects like classes and nodes. It is apparently functional, but I have not gone through all of the other tests to fix them yet. That is next.
* Doing a small amount of refactoring, toward being able to use Parser ↵Luke Kanies2007-09-031-8/+10
| | | | resources to evaluate classes and nodes, not just definitions. This will hopefully simplify some of the parsing work, and it will enable the use of a Configuration object that more completely models a configuration.
* Renaming the "configuration" object to "compile", because it is only a ↵Luke Kanies2007-08-251-2/+2
| | | | transitional object and I want the real "configuration" object to be the thing that I pass from the server to the client; it will be a subclass of GRATR::Digraph.
* A round of bugfixing. Many more tests now pass -- I think we are largely ↵Luke Kanies2007-08-201-0/+2
| | | | down to tests that (yay!) fail in trunk.
* All language tests now pass. I expect there are other failures elsewhere, ↵Luke Kanies2007-08-201-2/+1
| | | | but I want to commit this before delving into them. My method for fixing the tests was to do as little as possible, keeping the tests as bad or as good as they were before I started. Mostly this was about changing references to the interpreter into references to the parser (since that is where the new* methods are now for ast containers) and then dealing with the new config object and its relationship to scopes.
* The first pass where at least all of the snippet tests pass. I have ↵Luke Kanies2007-08-201-155/+164
| | | | unfortunately had to stop being so assiduous in my rewriting of tests, but I am in too much of a time crunch to do this "right". The basic structure is definitely in place, though, and from here it is a question of making the rest of the tests work and hopefully writing some sufficient new tests, rather than making the code itself work.
* The new parser configuration object works now,Luke Kanies2007-08-161-1/+4
| | | | | | | | | | | | | | but the rest of the compiling process is hosed (although the parser itself should still be fine). The configuration object is unifying a lot of work that was scattered around either the interpreter or the scopes, and it simplifies the whole system. However, its new simplicity has made the complexity of the rest of the system that much more apparent, and I am resolved to fixing the system rather than hacking it sufficiently to just make it work.
* Fixing error message when a parameter is getting redefinedluke2007-07-141-7/+11
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2693 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding patch by Valentin Vidic to add the "+>" syntax for adding values to ↵luke2007-07-101-0/+5
| | | | | | parameters git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2670 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #689, although I have not added unit tests. The problem was that a ↵luke2007-07-051-3/+3
| | | | | | tag name was being removed, rather than the tag object itself. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2651 980ebf18-57e1-0310-9a29-db15c13687c0
* All rails and language tests now pass again. All of the rails tests should ↵luke2007-06-171-1/+10
| | | | | | now be in the rails/ directory, and I have modified resource translation so that it always converts single-member arrays to singe values, which means the rails collection does not need to worry about it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2597 980ebf18-57e1-0310-9a29-db15c13687c0
* Significantly optimizing the database queries -- I am getting about 40% ↵luke2007-06-141-1/+1
| | | | | | better times now. See http://www.madstop.com/optimizing_the_activerecord_integration.html. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2585 980ebf18-57e1-0310-9a29-db15c13687c0
* Major rework of the rails feature. Changed the relationship between ballman2007-06-121-42/+74
| | | | | | | | | | | | | | | | host and facts (now many-to-many with fact_name through fact_values). Also changed the relationship between resource and params (similarly many-to-many with param_names through param_values). Added the resource_tags and puppet_tags. The latter has the tag names and the former is the man-to-many link with resources. There is a little clean up left but the schema is in order. Also a test for the tags stuff is required. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2565 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #637 -- defined resources can now correctly be virtual or exportedluke2007-06-111-0/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2562 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding #629 -- an undef keyword now existsluke2007-05-171-1/+4
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2522 980ebf18-57e1-0310-9a29-db15c13687c0
* Removed acts_as_taggable from the rails stuff. I haven't removed the tables ↵ballman2007-05-111-5/+3
| | | | | | from the schema nor the indexes yet. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2505 980ebf18-57e1-0310-9a29-db15c13687c0
* Working a little bit on rails failures, with no real progressluke2007-04-301-3/+3
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2439 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding extra info to the "Parameter already set" error, as requested in #573luke2007-04-261-2/+12
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2416 980ebf18-57e1-0310-9a29-db15c13687c0
* Refactoring some of the rails code. The speed is now pretty good, but the ↵luke2007-03-241-23/+11
| | | | | | tagging stuff does not seem to be working and is certainly working very ineffficiently. Blake says he is going to take a look at that. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2350 980ebf18-57e1-0310-9a29-db15c13687c0
* Rails is now significantly faster. I refactored all of the queries; they ↵luke2007-03-221-18/+37
| | | | | | are mostly reduced to three queries, each of which is relatively fast, although there are still a ton of file- and tag-related queries that I cannot find the source of. Note that this speedup requires indexes, which will only get added if you start puppetmasterd with --dbmigrate (although you cannot always start with that, as there is an error in the init code). I expect that the indexes will not help unless you forcibly reindex your database, but after that you should see significant speed improvements. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2344 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding #539. Definitions can now have titles, and both $title and $name are ↵luke2007-03-191-3/+4
| | | | | | guaranteed to be set within any definition. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2301 980ebf18-57e1-0310-9a29-db15c13687c0
* Undo the param_name param_value mergeshadoi2007-02-171-2/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2209 980ebf18-57e1-0310-9a29-db15c13687c0
* Merge fact_names & fact_values, and param_names & param_values.shadoi2007-02-151-0/+2
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2191 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #391. Keeping track of times of compile and freshness checks.luke2007-01-041-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2034 980ebf18-57e1-0310-9a29-db15c13687c0
* Modifying the "Resource#set" method to simplifying adding new parametersluke2007-01-011-1/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2013 980ebf18-57e1-0310-9a29-db15c13687c0
* Re-add support for tags and file/linesshadoi2006-12-191-11/+9
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1953 980ebf18-57e1-0310-9a29-db15c13687c0
* All rails *and* language tests now pass, with the exception of a ↵luke2006-12-191-11/+1
| | | | | | language/resource test that passes by itself but fails when run as part of the whole suite. Also, I added deletion where appropriate, so that unspecified resources, parameters, and facts are now deleted, as one would expect. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1951 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing most of the rails stuff. I think everything basically works now, and ↵luke2006-12-191-41/+33
| | | | | | now I am just going through and making sure things get deleted when they are supposed (i.e., you remove a resource and it gets deleted from the host's config). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1950 980ebf18-57e1-0310-9a29-db15c13687c0
* Go back to restype and remove STI classes, they were more trouble than they ↵shadoi2006-12-151-3/+3
| | | | | | were worth. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1940 980ebf18-57e1-0310-9a29-db15c13687c0
* New rails stuff redux.shadoi2006-12-141-14/+15
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1925 980ebf18-57e1-0310-9a29-db15c13687c0
* Working some on the export/collect problem. It actually works now, but ↵luke2006-12-121-1/+1
| | | | | | there are not yet sufficient tests for it, so I will leave the bug open until we have got the new work in place. I also added a "rails" feature, so I do not have to keep testing whether ActiveRecord is defined. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1911 980ebf18-57e1-0310-9a29-db15c13687c0
* Temporarily reverting all of the recent rails work so that I can release 0.20.1luke2006-11-131-5/+7
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1873 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #339, and the bigger problem it concealed. Metaparams are now only ↵luke2006-11-131-0/+4
| | | | | | added to resources that do not explicitly set them. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1869 980ebf18-57e1-0310-9a29-db15c13687c0
* Rails stuff part 1shadoi2006-11-091-7/+5
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1837 980ebf18-57e1-0310-9a29-db15c13687c0
* Many, many, many performance improvements in the compiler (I hope). I did ↵luke2006-10-061-29/+48
| | | | | | not change functionality anywhere, but I did some profiling and significantly reduced the runtime of many methods, and especially focused on some key methods that run many times. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1739 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the changes from the override-refactor branch. This is a ↵luke2006-10-041-0/+324
significant rewrite of the parser, but it has little affect on the rest of the code tree. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1726 980ebf18-57e1-0310-9a29-db15c13687c0