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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to