diff options
| author | James Turnbull <james@lovedthanlost.net> | 2008-06-17 19:32:50 +1000 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2008-06-17 19:32:50 +1000 |
| commit | 0f501e327dc767bb09d92429693f51629782065a (patch) | |
| tree | 27902bc7bc772a4eb97ca712808ddd7ae16ba32c /lib/puppet | |
| parent | d6943cd6154d80445eeb58721ab2e16bb17bff02 (diff) | |
| parent | 4d9536418d8f684923063eac03d3a59d69bb3794 (diff) | |
Merge branch 'tickets/0.24.x/1221' of git://github.com/lak/puppet into 0.24.x
Conflicts:
CHANGELOG
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/node/catalog.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/node/catalog.rb b/lib/puppet/node/catalog.rb index 7d9a83795..720b3752d 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 |
