Hi >> + def self.updates >> + self.fetch_yumlatest unless defined? @updates >> + @updates >> + end > > Why even set @updates? Why not just return the hash? Is that > instance variable used anywhere else? > > I've had lots of problems using instance variables in long-lived > processes, so it'd be good if we could get rid of this one. I know > it's there now, but this seems like a good way to get rid of it.
agree. but I currently don't see how to avoid it. fetch_yumlatest will call yumhelper.py and collect the script-output of the packages in @updates. and if puppet is calling latest, the method will use this fetched array (via self.updates) to check if the package is up to date. So actually it is stored only once, but accessed once per each package. so to avoid the instance variable (which is actually on the class side and therefor imho instanced only once over the whole process) we could to something like calling yumhelper once per package. however as this seems time and resource intensive, it's better to prefetch and only use once. or did I understand you wrong or don't see a cool way of how to do it? greets pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
