summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails
Commit message (Collapse)AuthorAgeFilesLines
* Removed extra whitespace from end of linesIan Taylor2009-06-0611-26/+26
|
* Always providing a value for 'exported' on Rails resourcesLuke Kanies2009-06-031-2/+11
| | | | | | | | | | | We often didn't set a value, unless it was true, which meant that if it had previously been true but was now false, we didn't fix it. We also were not always saving modified resources, which in some cases resulted in work not getting saved. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2187 - Puppet::Resource is expected by Rails supportLuke Kanies2009-04-243-14/+13
| | | | | | | | | | | | | We previously used and expected Puppet::Parser::Resource instances, but 0.25 converts them all to Puppet::Resource instances before they're passed out of the compiler, so the Rails integration had to be changed to expect that. There's still some muddling, because the rails resources only generate parser resources, but that works for now because that's what we expect when collecting resources. Signed-off-by: Luke Kanies <luke@madstop.com>
* Added class_name tags to has_many relationshipssteve mcintosh2009-04-221-3/+3
|
* renaming a methodLuke Kanies2009-04-222-10/+10
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adjusted parameter name and puppet tag classes to use new cache accumulator ↵Ethan Rowe2009-04-222-18/+7
| | | | | | behavior for storeconfigs. Removed per-class implementatiosn of accumulate_by_name from affected classes.
* Saving rails resources as I create them, which saves about 10%Luke Kanies2009-04-221-0/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding some more fine-grained benchmarks to Rails supportLuke Kanies2009-04-222-22/+26
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a Rails-specific benchmarking moduleLuke Kanies2009-04-223-39/+107
| | | | | | | This just slightly simplifies adding lots of time-debug stuff in Rails. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding simplistic param_name/puppet_tag cachingLuke Kanies2009-04-223-2/+22
| | | | | | | This has a drastic affect on performance - cuts about 25% off of the store time. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding more time debugging to Rails code, and refactoring a bitLuke Kanies2009-04-222-30/+10
| | | | | | | | There is an accumulation in the resource tags (hackish enough but soon to be replaced), and I've fixed a small bug in the tags merging that was causing lots of extra work (like 3x). Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the Rails integrationLuke Kanies2009-04-223-83/+306
| | | | | | | | This moves all code from the Parser class into the ActiveRecord classes, and gets rid of 'ar_hash_merge'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding ActiveRecord terminus classes for Node and Facts.Luke Kanies2009-04-221-1/+25
| | | | | | | | | This is most of the way to replacing standard StoreConfigs integration with the Indirector. We still need to convert the Catalog and then change all of the integraiton points (which is mostly the 'store' call in the Compiler). Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2010 - add protection code for some storeconfig corruptionBrice Figureau2009-03-041-14/+28
| | | | | | | | | | | | | | This patch adds a more robust and self-healing storedconfig in case of logically corrupted database as the one in #2010 (where multiple resources of same references are present in the database for the same host). The problem is that the resources are stored in a hash with the resource ref as the key, so we collapse resource of different id but same reference. The patch fixed this by using a hash by resource id, and maintaining a list of old extraneous resource in the db that are removved after the storeconfig pass. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Use Puppet.debug instead of own debug flagPeter Meier2009-02-221-7/+5
| | | | | | It's better to use puppet's logging environment than an own. Especially if the default is quite verbose and can't be set by config flag.
* Fix #1972 - ActiveRecord fixes resulted in broken testsBrice Figureau2009-02-151-3/+4
| | | | | | | Fix #1930 was not complete, with some typos and misuse of unused code paths in the regular puppetmaster use case. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #1959 - Added column protection for environment schema migrationJames Turnbull2009-02-121-2/+6
|
* Change the way the tags and params are handled in railsBrice Figureau2009-02-062-23/+88
| | | | | | | | | | | | | The rationale behind this patch is that it takes a lots of time to let rails unserialize the ParamValue and ResourceTag object on each compilation, just to throw them away the second after. The idea is to fetch directly (and batched host per host) the parameters and tags from the database and then returns them as hash. This allows the no-modification case to takes at least 2 times less than before. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add methods to return hash instead of objects to params and tagsBrice Figureau2009-02-062-12/+49
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Rename migration so it's still appliedThom May2008-11-261-0/+0
|
* Slight denormalisation to store a host's environment as a first classThom May2008-11-263-0/+14
| | | | | object in the database Fixes: #1392
* id column is autogenerated by rails as a primary key, there is no needBrice Figureau2008-08-222-8/+17
| | | | | | | to create an additional index on this column. This changeset contains the new schema and a migration. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1052 - abysmal storeconfig performance - part1Brice Figureau2008-08-171-1/+1
| | | | | | | | | | | | | | Resources whose references are of the form: Main::Sub1::Sub2 are extracted from the database under the form: Main::sub1::sub2 Puppet then fails to match them against compiled resources of same references which are capitalized as they should, and tries to overwrite them on every storeconfig run, leading to tons of cascading DELETE/INSERT, hurting performance. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1510 - storeconfig fails with rails 2.1Brice Figureau2008-08-171-5/+5
| | | | | | | | This is a workaround. Since rails seems to have difficulties to map associations to Puppet classes, we explain it carefully what to expect. Changelog
* Replacing all two-space indents with four-spaceLuke Kanies2008-06-131-14/+14
|
* Pushed schema patch for #1193James Turnbull2008-04-172-0/+10
|
* * Tweaks for puppetshow UI cleanupBlake Barnett2008-02-285-3/+17
|
* * Add migration for "created_at" (hobo expects it)Blake Barnett2008-02-287-139/+17
| | | | | * Tweaks for puppetshow interface cleanup * Delete unused tagging lib and puppet_class model
* Fixing #923 (again). The host storage method was notLuke Kanies2007-12-101-3/+1
| | | | | | correctly searching for the host, so it was creating a new host on each run, which is what was causing the conflict.
* Theoretically, this patch is to fix #917 (which it does), butLuke Kanies2007-11-281-3/+1
| | | | | | | | | | | | | | | | | | | 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.
* Removing the Id tags from all of the filesLuke Kanies2007-10-035-5/+0
|
* Fixed #784 by applying patch by vvidic.Michael V. O'Brien2007-09-111-1/+1
|
* A round of bugfixing. Many more tests now pass -- I think we are largely ↵Luke Kanies2007-08-202-14/+8
| | | | down to tests that (yay!) fail in trunk.
* Undo previous commit, which was an errorlutter2007-08-031-24/+5
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2735 980ebf18-57e1-0310-9a29-db15c13687c0
* Do not set any options if they aren't set in /etc/sysconfig/puppetmaster - ↵lutter2007-08-031-5/+24
| | | | | | otherwise we clobber settings from puppet.conf git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2734 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #695 -- resource references will correctly serialize and unserialize ↵luke2007-07-182-2/+20
| | | | | | in the db git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2706 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #703, mostly. You still cannot do multi-condition queries, but you ↵luke2007-07-181-0/+5
| | | | | | can at least query against any parameter, and matching any value is sufficient for a match, so the tags work fine. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2705 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #689, although I have not added unit tests. The problem was that a ↵luke2007-07-051-1/+2
| | | | | | 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
* Fixing some failing tests.luke2007-06-181-0/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2616 980ebf18-57e1-0310-9a29-db15c13687c0
* All rails and language tests now pass again. All of the rails tests should ↵luke2007-06-171-6/+9
| | | | | | 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
* Fixing the type/title index for mysqlluke2007-06-151-1/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2590 980ebf18-57e1-0310-9a29-db15c13687c0
* Significantly optimizing the database queries -- I am getting about 40% ↵luke2007-06-143-9/+12
| | | | | | 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
* Adding indexes for the rails tablesluke2007-06-141-0/+24
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2575 980ebf18-57e1-0310-9a29-db15c13687c0
* Removing the indexes migration, since the indexes are now in the main db schemaluke2007-06-131-38/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2574 980ebf18-57e1-0310-9a29-db15c13687c0
* Changed the host to "eager fetch" all the resources and their associated ballman2007-06-122-4/+4
| | | | | | | | tables. Also removed some unecessary lines from resource.rb that were causng it to re-read information it already loaded from the db. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2568 980ebf18-57e1-0310-9a29-db15c13687c0
* Major rework of the rails feature. Changed the relationship between ballman2007-06-128-69/+127
| | | | | | | | | | | | | | | | 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
* Changing the resource title to be text instead of a string, because some ↵luke2007-05-301-1/+1
| | | | | | title are > 255 chars git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2539 980ebf18-57e1-0310-9a29-db15c13687c0
* Removed acts_as_taggable from the rails stuff. I haven't removed the tables ↵ballman2007-05-113-18/+0
| | | | | | from the schema nor the indexes yet. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2505 980ebf18-57e1-0310-9a29-db15c13687c0
* Refactoring some of the rails code. The speed is now pretty good, but the ↵luke2007-03-242-46/+34
| | | | | | 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-223-25/+79
| | | | | | 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