summaryrefslogtreecommitdiffstats
path: root/lib/puppet/resource.rb
Commit message (Collapse)AuthorAgeFilesLines
* Bundling of pure ruby json lib as "pson"Markus Roberts2009-10-171-19/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bundeling and renaming the pure ruby json library to addresses a number of cross version serliaization bugs (#2615, et al). This patch adds a subset of the files from the json_pure gem to lib/puppet/external/pson (renamed to avoid conflicts with rails) so that we will always have a known-good erialization format available. The pure ruby json gem as distibuted defers to the compiled version if it is installed. This is problematic in some circumstances so the files that have been brought over have been modified to always and only use the bundled version. It's a large patch, so here's a breakdown of the change categories: The majority of the lines are only marginally interesting: * The json lib itself (in lib/puppet/external/pson) make up the bulk of the lines. * Renaming of json to pson make up the second largest group. Somewhat more interesting are the following, which can be located by searching the diffs for the indicated strings: * Adjusting tests to reflect the changes * Changing the encoding/decoding behavior so that nested structures (e.g. resources) don't serialize as escaped strings. This should make it much easier to process the results with external tools, if needed. Search for "to_pson" and "to_pson_data_hash" * Cleaning up the envelope/metadata * Now provides a document_type (as opposed to a ruby class name) by using a symple registration scheme instead of constant lookup (search for "document_type") * Added an api_version (search for "api_version") * Added a hash for document metadata (search for "metadata") * Removing the yaml monkeypatch and instead disabling yaml serialization on ruby 1.8.1 in favor of pson (search for "yaml") * Cleaning up the json/rails feature interaction (they're now totally independent) (search for "feature")
* Fix for #2621 (JSON serialization of exec)Markus Roberts2009-09-161-1/+0
| | | | | | | Removed the array wrapping of values for JSON serialization, and the associated test. Signed-off-by: Markus Roberts <Markus@reality.com>
* Fix #2507 - Exported resources were not correctly collected.Brice Figureau2009-08-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | #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>
* Changing the preferred serialization format to jsonLuke Kanies2009-06-061-8/+0
| | | | | | | | | This won't affect most people, but it's a good default to have for those who can support it. Signed-off-by: Luke Kanies <luke@madstop.com> Minor changes to previous commit
* Providing JSON support to the Resource classLuke Kanies2009-06-061-3/+69
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing a bunch of warningsLuke Kanies2009-06-031-1/+2
| | | | | | This commit should have no functional effect. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding an 'Exported' attribute to Puppet::ResourceLuke Kanies2009-04-241-1/+5
| | | | | | This is required for Rails support. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2112 - Transactions handle conflicting generated resourcesLuke Kanies2009-04-171-1/+1
| | | | | | | | | | 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>
* Fixing tests broken during the #1405 fix.Luke Kanies2009-02-061-0/+10
| | | | | | Most of these were small changes, like moved methods. Signed-off-by: Luke Kanies <luke@madstop.com>
* Deprecating the Puppet::Type.create.Luke Kanies2008-12-181-2/+2
| | | | | | | This method is no longer necessary; you can use the normal 'new' class method. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding name/namevar abstraction to Puppet::Resource.Luke Kanies2008-12-181-7/+33
| | | | | | | This hopefully provides a single place to manage this complexity, and I'll be using it to simplify Puppet::Type. Signed-off-by: Luke Kanies <luke@madstop.com>
* Replacing TransObject usage with Puppet::ResourceLuke Kanies2008-12-181-14/+14
| | | | | | | | | This completely reorganizes how RAL resources are initialized, and in the process I was able to remove a lot of code (I removed other apparently obsolete code at the same time). Signed-off-by: Luke Kanies <luke@madstop.com>
* Renaming Puppet::ResourceReference to Puppet::Resource::ReferenceLuke Kanies2008-12-091-4/+4
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding Trans{Object,Bucket} backward compatibility to Puppet::ResourceLuke Kanies2008-12-091-0/+57
| | | | | | This is further progress toward #1808. Signed-off-by: Luke Kanies <luke@madstop.com>
* Starting on #1808 - Added a base resource class.Luke Kanies2008-12-091-0/+107
This class borrows heavily from the Puppet::Parser::Resource class and from Puppet::TransObject, partially because it will hopefully eventually supplant both of them. The class isn't used at all yet; now we need to go through the codebase and remove everything related to TransObject. Signed-off-by: Luke Kanies <luke@madstop.com>