This issue is also hindering me as well. I have some disparate types that update sections of a mapped XML document they all share. Anyway, here is my attempt, in the form of a pull request!
https://github.com/puppetlabs/puppet/pull/1800 In the mean time, I'm going to try to test some of the alternatives you all listed here. On Monday, July 22, 2013 1:26:04 PM UTC-4, Trevor Vaughan wrote: > > Hmm...thanks for the update. I'll have to try that and see if it works in > this case. Other variations that I tried did not for one reason or another. > > Trevor > > > On Sun, Jul 21, 2013 at 10:07 PM, Eric Badger > <[email protected]<javascript:> > > wrote: > >> This is decidedly tangential to this thread's topic, but just briefly, >> here is what I mean (a "class instance" variable, or whatever you call it): >> >> Puppet::Type.type(:blah).provide(:bloo) do >> @class_var = 'stuff' >> class << self >> attr_accessor :class_var >> end >> >> def some_instance_method >> self.class.class_var = 'newstuff' >> end >> ... >> >> >> >> Eric >> >> >> Date: Sun, 21 Jul 2013 20:24:02 -0400 >> Subject: Re: [Puppet-dev] finalize/cleanup for a provider >> From: [email protected] <javascript:> >> To: [email protected] <javascript:> >> >> From what I tried, instance variables stick with the single instance of >> the provider, they don't carry across all providers of the same type. >> Since, I'm trying to share across the various instances of a provider, I >> have to use a class variable. Unfortunately, I couldn't figure out how to >> do it without polluting the global namespace. >> >> The native 'mount' provider does the same thing so I didn't dig much >> deeper to figure out how to work around it. >> If someone does, I'd love to hear how. >> >> Trevor >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/puppet-dev. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > -- > Trevor Vaughan > Vice President, Onyx Point, Inc > (410) 541-6699 > [email protected] <javascript:> > > -- This account not approved for unencrypted proprietary information -- > -- 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. For more options, visit https://groups.google.com/groups/opt_out.
