This is necessary because we now actually test for
whether a property conflicts with a metaparam or
whatever, and the 'alias' property on Nagios types conflicts
with the metaparams.

This is not a critical part of this refactor, and could
be removed if it's considered unsafe.

Signed-off-by: Luke Kanies <[email protected]>
---
Local-branch: refactor/master/8233-refactor_parameter_management
 lib/puppet/util/nagios_maker.rb |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/util/nagios_maker.rb b/lib/puppet/util/nagios_maker.rb
index 863fe24..3bb4903 100644
--- a/lib/puppet/util/nagios_maker.rb
+++ b/lib/puppet/util/nagios_maker.rb
@@ -27,6 +27,14 @@ module Puppet::Util::NagiosMaker
       # supported.
       next if param.to_s =~ /^[0-9]/
 
+      # As of summer 2011, this consistently happens with the 'alias'
+      # parameter, and this change means you can't manage 'alias' on Nagios
+      # resources.
+      if type.parameter(param)
+        Puppet.info "Not defining #{param} on Nagios type #{type.name} - 
duplicate parameter name"
+        next
+      end
+
       type.newproperty(param) do
         desc "Nagios configuration file parameter."
       end
-- 
1.7.3.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to