Issue #15576 has been reported by Nick Fagerlund.
----------------------------------------
Bug #15576: Deprecate "search()" function, or maybe just kill it with prejudice
https://projects.puppetlabs.com/issues/15576
Author: Nick Fagerlund
Status: Needs Decision
Priority: Normal
Assignee: eric sorenson
Category: functions
Target version:
Affected Puppet version:
Keywords:
Branch:
# lib/puppet/parser/functions/search.rb
Puppet::Parser::Functions::newfunction(:search, :doc => "Add another
namespace for this class to search.
This allows you to create classes with sets of definitions and add
those classes to another class's search path.") do |vals|
vals.each do |val|
add_namespace(val)
end
end
This should die immediately. It was meant to let you manually hack together
something kind of like the autoloader for defined types contained in classes.
It takes some work to get it to actually do anything, but I managed:
class parent {
define doessomething { notice("parentvar is set, in the
parent::doessomething define") }
class whoa { notice("Okay that works w/ classes too") }
$otherparentvar = "haha whoa"
}
search('parent')
doessomething{'something':} # Otherwise would have to be
parent::doessomething
include whoa # Otherwise would have to be parent::whoa
notice($otherparentvar) # This one won't work, because it only attaches the
NAMESPACE, not the SCOPE.
I don't think this even needs a deprecation period, really. Partly because it's
a plugin so users could just dump into a module if they needed it, but mostly
because I cannot believe this is actually in use anywhere.
--
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.