I have been working on a custom provider for User resources, relying in part on the documentation on the Wiki: http://reductivelabs.com/trac/puppet/wiki/CompleteResourceExample http://reductivelabs.com/trac/puppet/wiki/ProviderDevelopment Somewhat to my surprise, my provider is generally working. Contrary to the Wiki docs, however, I found that when an existing User resource is ensured absent, the method invoked on my provider is named "delete", not "destroy". Is this a peculiarity of the User type, or is the wiki simply incorrect? Digging further, it appears that among the standard User providers, only user_role_add has an explicit "destroy" method. None of the standard providers explicitly defines a "delete" method, but it appears that some of them may acquire one by declaring :delete among their commands. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, Jul 10, 2009 at 1:15 PM, jcbollinger<John.Bollinger@stjude.org> wrote:> > I have been working on a custom provider for User resources, relying > in part on the documentation on the Wiki: > > http://reductivelabs.com/trac/puppet/wiki/CompleteResourceExample > http://reductivelabs.com/trac/puppet/wiki/ProviderDevelopment > > Somewhat to my surprise, my provider is generally working. > > Contrary to the Wiki docs, however, I found that when an existing User > resource is ensured absent, the method invoked on my provider is named > "delete", not "destroy". Is this a peculiarity of the User type, or > is the wiki simply incorrect?Is your :parent => Puppet::Provider::NameService::ObjectAdd ? if so, is this what''s doing that? class Puppet::Provider::NameService class ObjectAdd < Puppet::Provider::NameService def deletecmd [command(:delete), @resource[:name]] end When doing the directoryservice nameservice/user provider, I had to define deletecmd to specify the deletion.> > Digging further, it appears that among the standard User providers, > only user_role_add has an explicit "destroy" method. None of the > standard providers explicitly defines a "delete" method, but it > appears that some of them may acquire one by declaring :delete among > their commands. > > > >-- Nigel Kersten nigelk@google.com System Administrator Google, Inc. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Nigel Kersten wrote:> Is your :parent => Puppet::Provider::NameService::ObjectAdd ?No, I have not specified an explicit parent, so I get Puppet::Provider as the superclass (which I confirmed by adding a "puts self.superclass" to the end of the class definition and observing the output). It sure appears to me that User is assuming a different API than the general one that the wiki led me to expect. Is there some subtlety here that I am not appreciating? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, Jul 10, 2009 at 3:47 PM, jcbollinger<John.Bollinger@stjude.org> wrote:> > > Nigel Kersten wrote: >> Is your :parent => Puppet::Provider::NameService::ObjectAdd ? > > No, I have not specified an explicit parent, so I get Puppet::Provider > as the superclass (which I confirmed by adding a "puts > self.superclass" to the end of the class definition and observing the > output). It sure appears to me that User is assuming a different API > than the general one that the wiki led me to expect. > > Is there some subtlety here that I am not appreciating?Probably :) to: puppet-dev bcc: puppet-users -- Nigel Kersten nigelk@google.com System Administrator Google, Inc. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 10, 2009, at 1:15 PM, jcbollinger wrote:> > I have been working on a custom provider for User resources, relying > in part on the documentation on the Wiki: > > http://reductivelabs.com/trac/puppet/wiki/CompleteResourceExample > http://reductivelabs.com/trac/puppet/wiki/ProviderDevelopment > > Somewhat to my surprise, my provider is generally working. > > Contrary to the Wiki docs, however, I found that when an existing User > resource is ensured absent, the method invoked on my provider is named > "delete", not "destroy". Is this a peculiarity of the User type, or > is the wiki simply incorrect?It''s a peculiarity of the User type. This is, unfortunately, an area in which we haven''t been able to enforce standardization through a clean API (although I''ve got ideas for one), and no one has particularly felt like going through all of the existing types and providers and just generally enforcing it. More recent types and providers tend to follow the convention described on the wiki, but Users and Packages were the types that resulted in providers, and thus were the first to use them, so they tend to not follow convention.> > Digging further, it appears that among the standard User providers, > only user_role_add has an explicit "destroy" method. None of the > standard providers explicitly defines a "delete" method, but it > appears that some of them may acquire one by declaring :delete among > their commands.Most likely, they all inherit Nameservice or one of its children. That whole class heirarchy needs to be converted to modules and mixins, but until that''s done, it''s a bit messy. (And if there''s a thread you think I should be replying to but am not, feel free to forward it to me or puppet-dev.) -- We cannot really love anybody with whom we never laugh. --Agnes Repplier --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---