On Tue, Nov 18, 2008 at 9:20 PM, Luke Kanies <[EMAIL PROTECTED]> wrote: > > 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
Would it make more sense to define this in type.rb than in a specific service type? That would seem more sensible if I'm understanding all the inheritance correctly? > > 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. It seems to make sense to make it as transparent as possible to me. Is doing it on the provider significantly more work than doing it in 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 > > > > > -- Nigel Kersten Systems Administrator Tech Lead - MacOps --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---