I aped the AIX one above it. :) On Mon, Apr 27, 2009 at 1:32 PM, Peter Meier <[email protected]> wrote: > > Hi > > I don't use hp-ux, so can't tell if this is the right code. However I'd > like to do a comment on the "style": > >> +if Facter.value(:kernel) == "HP-UX" >> + # no MemoryFree because hopefully there is none >> + if FileTest.exists?("/opt/ignite/bin/print_manifest") >> + mem = %x{/opt/ignite/bin/print_manifest}.split(/\n/).grep(/Main >> Memory:/).collect{|l| l.split[2]} >> + Facter.add(:MemorySize) do >> + setcode do >> + Facter::Memory.scale_number(mem[0].to_f,"MB") >> + end >> + end >> + end > > is there any reason you do it that way rather than: > > Facter.add(:MemorySize) do > confine :operatingsystem => :"hp-ux" > setcode do ....and so on > > if there is a particular reason to do it that way, the only comment I > have that the check on the kernel should be done by symbols. Facter > always downcases strings and these are equals to their symbol. > > If there is no particular reason for it I personally would prefer the > second way, as this looks imho less clumsy. > > Dunno what other think about it? > > cheers 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 -~----------~----~----~----~------~----~------~--~---
