summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-12-11 08:24:43 -0600
committerLuke Kanies <luke@madstop.com>2008-12-18 11:10:22 -0600
commit60062e4b9ae479ddbf97f4fc3495d04bc00196d5 (patch)
tree4eee797b0c2f883c1daeb383a07ca87749cd7d11 /lib/puppet
parent6b14000ae54a11da3fa16c1b4685f630abca869b (diff)
downloadpuppet-60062e4b9ae479ddbf97f4fc3495d04bc00196d5.tar.gz
puppet-60062e4b9ae479ddbf97f4fc3495d04bc00196d5.tar.xz
puppet-60062e4b9ae479ddbf97f4fc3495d04bc00196d5.zip
Renaming the "Catalog#to_type" method to "Catalog#to_ral"
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/parser/resource.rb4
-rw-r--r--lib/puppet/resource/catalog.rb9
-rw-r--r--lib/puppet/transportable.rb8
3 files changed, 12 insertions, 9 deletions
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index 75c885b61..12c1a8f52 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -327,8 +327,8 @@ class Puppet::Parser::Resource
# Convert this resource to a RAL resource. We hackishly go via the
# transportable stuff.
- def to_type
- to_resource.to_type
+ def to_ral
+ to_resource.to_ral
end
private
diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb
index 5b1022799..56534b6be 100644
--- a/lib/puppet/resource/catalog.rb
+++ b/lib/puppet/resource/catalog.rb
@@ -385,7 +385,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph
# Convert our catalog into a RAL catalog.
def to_ral
- to_catalog :to_type
+ to_catalog :to_ral
end
# Turn our parser catalog into a transportable catalog.
@@ -463,11 +463,14 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph
#Aliases aren't working in the ral catalog because the current instance of the resource
#has a reference to the catalog being converted. . . So, give it a reference to the new one
#problem solved. . .
- if resource.is_a?(Puppet::TransObject)
+ if resource.is_a?(Puppet::Resource)
+ resource = resource.dup
+ resource.catalog = result
+ elsif resource.is_a?(Puppet::TransObject)
resource = resource.dup
resource.catalog = result
elsif resource.is_a?(Puppet::Parser::Resource)
- resource = resource.to_transobject
+ resource = resource.to_resource
resource.catalog = result
end
diff --git a/lib/puppet/transportable.rb b/lib/puppet/transportable.rb
index 9e85b1fe7..c63e2419c 100644
--- a/lib/puppet/transportable.rb
+++ b/lib/puppet/transportable.rb
@@ -86,7 +86,7 @@ module Puppet
ref
end
- def to_type
+ def to_ral
if typeklass = Puppet::Type.type(self.type)
return typeklass.create(self)
else
@@ -189,13 +189,13 @@ module Puppet
delver = proc do |obj|
obj.catalog = catalog
unless container = catalog.resource(obj.to_ref)
- container = obj.to_type
+ container = obj.to_ral
catalog.add_resource container
end
obj.each do |child|
child.catalog = catalog
unless resource = catalog.resource(child.to_ref)
- resource = child.to_type
+ resource = child.to_ral
catalog.add_resource resource
end
@@ -233,7 +233,7 @@ module Puppet
@ref.to_s if @ref
end
- def to_type
+ def to_ral
Puppet.debug("TransBucket '%s' has no type" % @name) unless defined? @type
# Nodes have the same name and type