I''m building a module to handle django local_settings.py and I''m using a hash to store the database settings. The problem I ran into was the if I had multiple databases defined then it was possible for the config file to be recreated as the order of the databases in the hash wasn''t guaranteed. To work around this I sorted all the keys in the hash and enumerated over that. I''ve attached an example of what I''m doing in case anyone else bumps into this problem. Here''s what I''m doing: https://gist.github.com/1895347 Does anyone have a better solution? -- 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 Thu, Feb 23, 2012 at 5:20 PM, Jared Curtis <jared@shift-e.info> wrote:> Does anyone have a better solution?Better? I dunno. But an array of hashes will do what you want as well. dbs = [{:foo => ''bar''}, {:hai => ''bai''} ] dbs[0] etc. -- Nathan Powell Linux System Administrator "Now I see it clearly. My whole life has pointed in one direction. I see that now. There never has been any choice for me." ~ Travis Bickle -- 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.
Possibly Parallel Threads
- mrtg 2.16.2 ipv6 on centos 6
- [Bug 98630] New: Bad color and glitches on PPC64
- what is the recommended samba version on solaris?
- strucchange breakpoints (Bai and Perron, 1998, 2003)
- [Bug 98712] New: [PPC64] GPU Lock Up when Nouveau 2D acceleration is enabled + X failures