summaryrefslogtreecommitdiffstats
path: root/lib/puppet/resource/reference.rb
Commit message (Collapse)AuthorAgeFilesLines
* Removing Resource::Reference classesLuke Kanies2010-02-171-90/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is hopefully less messy than it first appears, but it's certainly cross-cutting. The reason for all of this is that we previously only looked up builtin resource types from outside the parser, but now that the defined resource types are available globally via environments, we can push that lookup code to Resource. Once we do that, however, we have to have environment and namespace information in every resource. Here I remove the Resource::Reference classes (except the AST class), and use Resource instances instead. I did this because the shared code between the two classes got incredibly complicated, such that they should have had a hierarchical relationship disallowed by their constants. This complexity convinced me just to get rid of References entirely. I also make Puppet::Parser::Resource a subclass of Puppet::Resource. There are still broken tests in test/, but this was a big enough commit I wanted to get it in. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* ReFix 2675 ending slash in directory should get stripped offJesse Wolfe2010-01-011-0/+4
| | | | | | | | | There was an intermittent bug in Puppet::Parser::Resource::Reference, during initialization, and object could sometimes have its title set before its type is set. This prevented the title from going through type-specific canonicalization. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Least kludgy patch for #2675Markus Roberts2009-11-141-25/+9
| | | | | | | | | | | | | This makes parameters responsible for the canonicalization of their values and provides a default (passthrough) implementation. It changes munge to pre- canonicalize the value and resource references to builtin types to canonicalize titles (which map to resorce namevars) with the corresponding parameter's classes's canonicalization. It adds a canonicalization routine to file paths that normalizes the behaviour (trailing slashes are ignored) and DRYs up the related code. Signed-off-by: Markus Roberts <Markus@reality.com>
* Ticket #2770 (deserializing Exec[...]s with "\n"s)Markus Roberts2009-11-121-1/+1
| | | | | | | | | | | The resource reference logic wasn't handling resources with "\n"s in their namevars gracefully, and detection of this was complicated by infelicitous exception reporting. Note that this patch will require a merge when combined with the patch for #2657. Signed-off-by: Markus Roberts <Markus@reality.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-2/+2
|
* Fixing a bunch of warningsLuke Kanies2009-06-031-2/+2
| | | | | | This commit should have no functional effect. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding equality to ResourceReferenceLuke Kanies2009-04-221-4/+2
| | | | | | | This is used by the Parser subclass when testing equality with db-backed references. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing all of the test/ tests I broke in previous dev.Luke Kanies2008-12-181-3/+8
| | | | | | | | | Most of these are straightforward changes to the tests, but a couple required small refactorings (e.g., References can now be created with Puppet::Type instances, and they know how to extract the type/title from them). Signed-off-by: Luke Kanies <luke@madstop.com>
* TransObject is nearly deprecated now.Luke Kanies2008-12-181-1/+3
| | | | | | | | | This is all of the plumbing work, the only real thing left to do is to fix the Settings class so that it uses Puppet::Resource instances instead of TransObject and TransBucket. Signed-off-by: Luke Kanies <luke@madstop.com>
* Simplifying the initialization interface for ReferencesLuke Kanies2008-12-181-5/+10
| | | | | | | | | You previously had to call new(nil, "Foo[bar]") if you just had the resource reference as a string. Now you can call new("Foo[bar]"), but the old behaviour works, too. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding equality testing to Puppet::Resource::ReferenceLuke Kanies2008-12-181-0/+6
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Renaming Puppet::ResourceReference to Puppet::Resource::ReferenceLuke Kanies2008-12-091-0/+86
Signed-off-by: Luke Kanies <luke@madstop.com>