summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-07-02 00:32:52 -0500
committerLuke Kanies <luke@madstop.com>2008-07-02 00:32:52 -0500
commit8e4312ed249d83ece754b80e993fa0d86bd36d46 (patch)
tree8b6044079dbb05a1f84a09a2f8e99cf1b87a3e9e /lib/puppet/node
parent49016bb29312bfeb6f41ce420159e6ffc477eebe (diff)
parentd3a81255245eec19ac21902ae3b877e00e620628 (diff)
downloadpuppet-8e4312ed249d83ece754b80e993fa0d86bd36d46.tar.gz
puppet-8e4312ed249d83ece754b80e993fa0d86bd36d46.tar.xz
puppet-8e4312ed249d83ece754b80e993fa0d86bd36d46.zip
Merge branch '0.24.x'
Conflicts: CHANGELOG spec/unit/node/catalog.rb spec/unit/type/package.rb spec/unit/type/schedule.rb spec/unit/type/service.rb spec/unit/util/settings.rb
Diffstat (limited to 'lib/puppet/node')
-rw-r--r--lib/puppet/node/catalog.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/node/catalog.rb b/lib/puppet/node/catalog.rb
index 3ac11a66d..9dbdb8d62 100644
--- a/lib/puppet/node/catalog.rb
+++ b/lib/puppet/node/catalog.rb
@@ -88,8 +88,13 @@ class Puppet::Node::Catalog < Puppet::PGraph
resource.ref =~ /^(.+)\[/
newref = "%s[%s]" % [$1 || resource.class.name, name]
+
+ # LAK:NOTE It's important that we directly compare the references,
+ # because sometimes an alias is created before the resource is
+ # added to the catalog, so comparing inside the below if block
+ # isn't sufficient.
+ return if newref == resource.ref
if existing = @resource_table[newref]
- return if existing == resource
raise(ArgumentError, "Cannot alias %s to %s; resource %s already exists" % [resource.ref, name, newref])
end
@resource_table[newref] = resource