diff options
author | Luke Kanies <luke@madstop.com> | 2008-02-25 19:40:44 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-02-25 19:40:44 -0500 |
commit | 125851278d745e443c0598fbb0577b010f824365 (patch) | |
tree | 6b7abbf4e6ce7a2542ceb2a88f8c9ce9b1e860e4 /lib | |
parent | 9a3348764b30ad355f14c27b497ae18ed20f9ea8 (diff) | |
download | puppet-125851278d745e443c0598fbb0577b010f824365.tar.gz puppet-125851278d745e443c0598fbb0577b010f824365.tar.xz puppet-125851278d745e443c0598fbb0577b010f824365.zip |
Fixing #1084 -- the node catalog asks the individual
resources whether they're isomorphic, and they in turn
ask the resource types (or default to true for defined
resource types).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/metatype/closure.rb | 4 | ||||
-rw-r--r-- | lib/puppet/node/catalog.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/resource.rb | 9 |
3 files changed, 14 insertions, 1 deletions
diff --git a/lib/puppet/metatype/closure.rb b/lib/puppet/metatype/closure.rb index 259854411..673a2359d 100644 --- a/lib/puppet/metatype/closure.rb +++ b/lib/puppet/metatype/closure.rb @@ -20,6 +20,10 @@ class Puppet::Type end end + def isomorphic? + self.class.isomorphic? + end + # is the instance a managed instance? A 'yes' here means that # the instance was created from the language, vs. being created # in order resolve other questions, such as finding a package diff --git a/lib/puppet/node/catalog.rb b/lib/puppet/node/catalog.rb index d680de9a0..f885a41ee 100644 --- a/lib/puppet/node/catalog.rb +++ b/lib/puppet/node/catalog.rb @@ -73,7 +73,7 @@ class Puppet::Node::Catalog < Puppet::PGraph # If the name and title differ, set up an alias #self.alias(resource, resource.name) if resource.respond_to?(:name) and resource.respond_to?(:title) and resource.name != resource.title if resource.respond_to?(:name) and resource.respond_to?(:title) and resource.name != resource.title - self.alias(resource, resource.name) if resource.class.isomorphic? + self.alias(resource, resource.name) if resource.isomorphic? end resource.catalog = self if resource.respond_to?(:catalog=) and ! is_relationship_graph diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index fb0799011..46be89ca2 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -133,6 +133,15 @@ class Puppet::Parser::Resource tag(@ref.title) if valid_tag?(@ref.title.to_s) end + # Is this resource modeling an isomorphic resource type? + def isomorphic? + if builtin? + return @ref.builtintype.isomorphic? + else + return true + end + end + # Merge an override resource in. This will throw exceptions if # any overrides aren't allowed. def merge(resource) |