summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
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