summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-03-06 13:20:30 -0700
committerLuke Kanies <luke@madstop.com>2008-03-06 13:20:30 -0700
commit4c0f6c8502a0759519877f3e933e44ba980f7da2 (patch)
treed8445e2b5065160fd8ad1248a01e04bf67d47228 /lib
parentee8fac6f24a35edf9234e49fb7aae71e625917f4 (diff)
downloadpuppet-4c0f6c8502a0759519877f3e933e44ba980f7da2.tar.gz
puppet-4c0f6c8502a0759519877f3e933e44ba980f7da2.tar.xz
puppet-4c0f6c8502a0759519877f3e933e44ba980f7da2.zip
Fix for 1094
Replace the catalog with the newly created one when converting to ral types. The aliases were being lost because the resources had references to the old catalog being converted
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/node/catalog.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/puppet/node/catalog.rb b/lib/puppet/node/catalog.rb
index f885a41ee..ecda472be 100644
--- a/lib/puppet/node/catalog.rb
+++ b/lib/puppet/node/catalog.rb
@@ -84,6 +84,7 @@ class Puppet::Node::Catalog < Puppet::PGraph
# Create an alias for a resource.
def alias(resource, name)
+ #set $1
resource.ref =~ /^(.+)\[/
newref = "%s[%s]" % [$1 || resource.class.name, name]
@@ -475,6 +476,15 @@ class Puppet::Node::Catalog < Puppet::PGraph
vertices.each do |resource|
next if resource.respond_to?(:virtual?) and resource.virtual?
+ #This is hackity hack for 1094
+ #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)
+ resource = resource.dup
+ resource.catalog = result
+ end
+
newres = resource.send(convert)
# We can't guarantee that resources don't munge their names