On Jan 26, 2013, at 10:52 AM, Daniel Lobato <[email protected]> wrote:
> Hi all, > > I have made the yumrepo type ensurable, but judging from the comments I see > in the pull request, it would be great to truly refactor this and separate > the provider logic from the provider. Hi Daniel, Thanks for taking this on. I've taken a couple of cracks at it, too, but have never quite finished my attempmts. > Therefore, I have a few questions: > > Why is IniProperty in the yumrepo type? What should I do with it? It is > required by all properties. It's essentially a support class for all of the properties, and I don't think it's used by any other type. > Not sure what to do with instances, inifile, store, flush.. I know I have to > move them to the provider but I can't figure out an elegant way to do it > without overloading the provider. What about the class << self I can find on > the type? My recommendation is to separate the type into a provider and a resource type. There's a ticket (https://projects.puppetlabs.com/issues/8758) I've worked on that gets most of the way there, but I never wrote the tests necessary to prove it, and since I don't use any red hat personally, I couldn't easily test it. If you pull all of the file editing into a provider, then most of the code becomes much clearer and much easier to maintain, and you get rid of most of the confusion you're mentioning. Maybe take a look at the patch attached to the above ticket, and see if it helps? > Here's the pull request, it works (makes my yumrepos ensurable) but the > type/provider separation thing has been bugging me for a while > > https://github.com/puppetlabs/puppet/pull/1236 -- Luke Kanies | http://about.me/lak | http://puppetlabs.com/ | +1-615-594-8199 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-dev?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
