On Nov 18, 2008, at 11:15 PM, Nigel Kersten wrote:
>
> how do you autorequire within a provider?
>
> or is that the wrong place and you should do it in the type?
You can currently only autorequire from a type. For now, just add a
hook to your type that checks to see if the provider supports
autorequire, and if so returns its results. Something like this:
autorequire(:stuff) do
if provider.respond_to?(:autorequire)
provider.autorequire(:stuff)
else
[]
end
end
I *think* that using 'return' here will behave wonkily (because of how
Ruby doesn't like 'return' in blocks).
This is something Andrew is constantly dinging me on -- how to provide
transparent access to the provider. I'm amenable to providing
something like this automatically. The transaction could be extended
to look for autorequires on the provider like it does on the type.
If someone has a recommended interface, I'm all ears. Or something
like that. The saying seems to work better when spoken. Seems kinda
stupid when written.
--
The chief lesson I have learned in a long life is that the only way to
make a man trustworthy is to trust him; and the surest way to make him
untrustworthy is to distrust him and show your distrust.
-- Henry L. Stimson
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---