Issue #6934 has been updated by Nigel Kersten.

So I actually implemented this in a function recently

https://github.com/nigelkersten/puppet-get

https://github.com/nigelkersten/puppet-get/blob/master/lib/puppet/parser/functions/get.rb

and we could definitely come up with a variant of 'include' that failed 
gracefully, it would basically be something like:

<pre>
Puppet::Parser::Functions::newfunction(:try_include, :type => :rvalue, :doc => 
"try include") do |args|
  begin
    include_class = Puppet::Parser::Functions.function(:include)
    send(include_class, arg[0])
  rescue
  end
end
</pre>

It however wouldn't work with parameterized classes.... which is a bit of a 
problem.
----------------------------------------
Bug #6934: non-fatal method for including classes
https://projects.puppetlabs.com/issues/6934

Author: Chuck Schweizer
Status: Needs More Information
Priority: Normal
Assignee: Nigel Kersten
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


There are use cases where people wish to attempt to include a given class, but 
not to fail if it cannot be found.

This functionality was accidentally provided by external node classifiers in 
2.6.x and earlier, but has been removed to achieve consistency in class 
declarations between ENCs and the DSL.

It should be simple to copy the include function and replace errors with a log 
message instead.

This probably isn't possible with parameterized classes.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to