summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/scope.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/scope.rb')
-rw-r--r--lib/puppet/parser/scope.rb23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 996a497d5..93d97e396 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -542,16 +542,21 @@ module Puppet
if obj == :undefined or obj.nil?
# Make sure it's not defined elsewhere in the configuration
if tmp = self.objectdefined?(name, type)
- msg = "Duplicate definition: %s[%s] is already defined" %
- [type, name]
- error = Puppet::ParseError.new(msg)
- if tmp.line
- error.line = tmp.line
- end
- if tmp.file
- error.file = tmp.file
+ typeklass = Puppet::Type.type(type)
+ if typeklass and ! typeklass.isomorphic?
+ Puppet.info "Allowing duplicate %s" % type
+ else
+ msg = "Duplicate definition: %s[%s] is already defined" %
+ [type, name]
+ error = Puppet::ParseError.new(msg)
+ if tmp.line
+ error.line = tmp.line
+ end
+ if tmp.file
+ error.file = tmp.file
+ end
+ raise error
end
- raise error
end
# And if it's not, then create it anew